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
(26) |
Aug
(48) |
Sep
(30) |
Oct
(8) |
Nov
(9) |
Dec
|
|
From: kosmirror <kos...@us...> - 2025-11-21 04:43: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 b4ba51022014b5ba860e2ba9015209ef0cdfc28f (commit)
via 3ad0d86cae562d2c728521667ce5639752381126 (commit)
via 51fdde63310d2cbe82728593b321a65e60c9593f (commit)
via 124794dc82fa0f0f9b8f7ad03815b37a53f9b478 (commit)
via fdf5089fe6064cc35624cd441ba9b7aab84cf332 (commit)
via 1495e8dee3cd50ec793c91492d61c5b188f2a8e5 (commit)
via 700c8423cb3db2a292401b7cb1217b25fac6f95d (commit)
via a4e246b012a5ea60009dcb856452b93c7d78580d (commit)
via 6ca1c196e89e76c202704b446695cd957c2d47b0 (commit)
via c1f398025b8618b2c7356ffcbeb91fe7d29f87c3 (commit)
via ab9074edbb9342459d7789a9c16a3437a7cc6534 (commit)
via 0fc163f313112c105bd9921d234319644c070982 (commit)
from 0ef0a6e931f9d973637d5908b68337a8c276e699 (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 b4ba51022014b5ba860e2ba9015209ef0cdfc28f
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 19:54:47 2025 +0200
mutex: Handle recursive/errcheck after trying to get lock
Speed up mutex locking for regular mutexes by handling
recursive/errcheck mutexes after the atomic compare-and-swap.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 3ad0d86cae562d2c728521667ce5639752381126
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 15:32:21 2025 +0200
mutex: Replace runtime checks by assert() calls
Allow applications to disable these runtime checks, by converting them
to assert() calls.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 51fdde63310d2cbe82728593b321a65e60c9593f
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 14:13:41 2025 +0200
mutex: Don't check interrupt context twice in mutex_lock()
In mutex_lock_timed() and mutex_lock(), we are already guaranteed (by an
assert()) to not be inside an interrupt context.
By reworking the code a little, we can ensure that the interrupt context
check is only done once.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 124794dc82fa0f0f9b8f7ad03815b37a53f9b478
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 21:31:45 2025 +0200
mutex: Make mutex_lock() a static inline
mutex_lock() is just a tiny wrapper around mutex_lock_timed() with just
an extra parameter.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit fdf5089fe6064cc35624cd441ba9b7aab84cf332
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 14:11:08 2025 +0200
mutex: Make timeout parameter to mutex_lock_timed() unsigned
By making this parameter unsigned, we do not have to handle the case
where it is negative.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 1495e8dee3cd50ec793c91492d61c5b188f2a8e5
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 14:07:58 2025 +0200
c11: Handle negative timeout in mtx_timedlock()
Don't bother to call mutex_lock_timed() with a negative timeout, since
we know that it will fail.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 700c8423cb3db2a292401b7cb1217b25fac6f95d
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 15:48:01 2025 +0200
genwait: Replace runtime check with assert() call
Allow applications to disable this runtime check, by converting it to an
assert() call.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit a4e246b012a5ea60009dcb856452b93c7d78580d
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 15:43:56 2025 +0200
genwait: Make timeout parameter to genwait_wait() unsigned
Negative timeout values are handled the same as a zero value, which
means that the parameter can be unsigned.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 6ca1c196e89e76c202704b446695cd957c2d47b0
Author: Paul Cercueil <pa...@cr...>
Date: Thu Sep 25 15:57:57 2025 +0200
net: Factorize code using mutex_lock_irqsafe()
The net_{tcp,udp}_getpeername() function were basically inlining
mutex_lock_irqsafe().
Signed-off-by: Paul Cercueil <pa...@cr...>
commit c1f398025b8618b2c7356ffcbeb91fe7d29f87c3
Author: Paul Cercueil <pa...@cr...>
Date: Mon Sep 29 11:15:47 2025 +0200
pthread: Implement errcheck mutexes with recursive mutexes
Instead of using KallistiOS' "errcheck" mutexes, which will be gone
soon, implement the errcheck mutexes using recursive mutexes and extra
checks.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit ab9074edbb9342459d7789a9c16a3437a7cc6534
Author: Paul Cercueil <pa...@cr...>
Date: Sun Sep 28 22:51:52 2025 +0200
pthread: Use new <kos/errno.h> macros
Use the errno_save_scoped() macro which allows to automatically save the
'errno' variable when it's called, and restore it right before exiting
the current functional block.
Use the errno_if_nonzero() macro to factorize the code further.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 0fc163f313112c105bd9921d234319644c070982
Author: Paul Cercueil <pa...@cr...>
Date: Sun Sep 28 23:00:03 2025 +0200
kos: Add <kos/errno.h> header to simplify errno handling
This new header contains functions and macros related to the 'errno'
variable.
Notably, it contains the errno_save_scoped() macro which will keep a
copy of the current value of the errno variable, and will restore it
once the execution exits the functional block in which the macro was
called.
It also contains the simple macro errno_if_nonzero(), which will return
the value of the 'errno' variable if the input value is non-zero, and
will otherwise return zero.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
addons/libpthread/pthread-internal.h | 1 +
addons/libpthread/pthread_attr_setname_np.c | 13 ++----
addons/libpthread/pthread_cond_broadcast.c | 11 ++---
addons/libpthread/pthread_cond_destroy.c | 11 ++---
addons/libpthread/pthread_cond_init.c | 12 +++---
addons/libpthread/pthread_cond_signal.c | 11 ++---
addons/libpthread/pthread_cond_timedwait.c | 11 ++---
addons/libpthread/pthread_cond_wait.c | 11 ++---
addons/libpthread/pthread_mutex_destroy.c | 11 ++---
addons/libpthread/pthread_mutex_init.c | 17 +++-----
addons/libpthread/pthread_mutex_lock.c | 17 +++++---
addons/libpthread/pthread_mutex_timedlock.c | 18 +++++---
addons/libpthread/pthread_mutex_trylock.c | 17 +++++---
addons/libpthread/pthread_mutex_unlock.c | 14 +++---
addons/libpthread/pthread_rwlock_destroy.c | 13 ++----
addons/libpthread/pthread_rwlock_init.c | 13 ++----
addons/libpthread/pthread_rwlock_rdlock.c | 13 ++----
addons/libpthread/pthread_rwlock_timedrdlock.c | 11 ++---
addons/libpthread/pthread_rwlock_timedwrlock.c | 11 ++---
addons/libpthread/pthread_rwlock_tryrdlock.c | 13 ++----
addons/libpthread/pthread_rwlock_trywrlock.c | 13 ++----
addons/libpthread/pthread_rwlock_unlock.c | 13 ++----
addons/libpthread/pthread_rwlock_wrlock.c | 13 ++----
include/kos/errno.h | 53 +++++++++++++++++++++++
include/kos/genwait.h | 3 +-
include/kos/mutex.h | 44 ++++++++++---------
kernel/exports.txt | 1 -
kernel/libc/c11/mtx_timedlock.c | 3 ++
kernel/net/net_tcp.c | 12 ++----
kernel/net/net_udp.c | 10 ++---
kernel/thread/genwait.c | 9 ++--
kernel/thread/mutex.c | 59 ++++++++++++--------------
utils/dc-chain/patches/gcc/gthr-kos.h | 9 ++--
33 files changed, 221 insertions(+), 270 deletions(-)
create mode 100644 include/kos/errno.h
diff --git a/addons/libpthread/pthread-internal.h b/addons/libpthread/pthread-internal.h
index c0b457cb..2ccf5bf5 100644
--- a/addons/libpthread/pthread-internal.h
+++ b/addons/libpthread/pthread-internal.h
@@ -47,6 +47,7 @@ typedef union pthread_attr_t {
typedef union pthread_mutex_t {
mutex_t mutex;
+ unsigned int type;
unsigned char __data[__PTHREAD_MUTEX_SIZE];
long int __align;
} pthread_mutex_t;
diff --git a/addons/libpthread/pthread_attr_setname_np.c b/addons/libpthread/pthread_attr_setname_np.c
index f972841e..a4e8f783 100644
--- a/addons/libpthread/pthread_attr_setname_np.c
+++ b/addons/libpthread/pthread_attr_setname_np.c
@@ -6,14 +6,12 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
#include <string.h>
+#include <kos/errno.h>
#include <kos/thread.h>
int pthread_attr_setname_np(pthread_attr_t *__RESTRICT attr,
const char *__RESTRICT name) {
- int old, rv;
-
if(!attr)
return EINVAL;
@@ -23,13 +21,10 @@ int pthread_attr_setname_np(pthread_attr_t *__RESTRICT attr,
if(strlen(name) >= KTHREAD_LABEL_SIZE)
return EINVAL;
- old = errno;
+ errno_save_scoped();
- if(!(attr->attr.label = strdup(name))) {
- rv = errno;
- errno = old;
- return rv;
- }
+ if(!(attr->attr.label = strdup(name)))
+ return errno;
return 0;
}
diff --git a/addons/libpthread/pthread_cond_broadcast.c b/addons/libpthread/pthread_cond_broadcast.c
index df5d9f8b..32339aef 100644
--- a/addons/libpthread/pthread_cond_broadcast.c
+++ b/addons/libpthread/pthread_cond_broadcast.c
@@ -7,16 +7,11 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/cond.h>
int pthread_cond_broadcast(pthread_cond_t *cond) {
- int old, rv = 0;
+ errno_save_scoped();
- old = errno;
- if(cond_broadcast(&cond->cond))
- rv = errno;
-
- errno = old;
- return rv;
+ return errno_if_nonzero(cond_broadcast(&cond->cond));
}
diff --git a/addons/libpthread/pthread_cond_destroy.c b/addons/libpthread/pthread_cond_destroy.c
index 30db2242..9c668d0b 100644
--- a/addons/libpthread/pthread_cond_destroy.c
+++ b/addons/libpthread/pthread_cond_destroy.c
@@ -7,16 +7,11 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/cond.h>
int pthread_cond_destroy(pthread_cond_t *cond) {
- int old, rv = 0;
+ errno_save_scoped();
- old = errno;
- if(cond_destroy(&cond->cond))
- rv = errno;
-
- errno = old;
- return rv;
+ return errno_if_nonzero(cond_destroy(&cond->cond));
}
diff --git a/addons/libpthread/pthread_cond_init.c b/addons/libpthread/pthread_cond_init.c
index e5c95332..f32aa7a1 100644
--- a/addons/libpthread/pthread_cond_init.c
+++ b/addons/libpthread/pthread_cond_init.c
@@ -7,19 +7,18 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/cond.h>
int pthread_cond_init(pthread_cond_t *__RESTRICT cond,
const pthread_condattr_t *__RESTRICT attr) {
- int old, rv = 0;
-
if(!cond)
return EFAULT;
- old = errno;
+ errno_save_scoped();
+
if(cond_init(&cond->cond))
- rv = errno;
+ return errno;
/* Copy attributes over into the condition variable. */
if(attr)
@@ -27,6 +26,5 @@ int pthread_cond_init(pthread_cond_t *__RESTRICT cond,
else
cond->clock_id = CLOCK_REALTIME;
- errno = old;
- return rv;
+ return 0;
}
diff --git a/addons/libpthread/pthread_cond_signal.c b/addons/libpthread/pthread_cond_signal.c
index a64681b7..2f35030c 100644
--- a/addons/libpthread/pthread_cond_signal.c
+++ b/addons/libpthread/pthread_cond_signal.c
@@ -7,16 +7,11 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
#include <kos/cond.h>
+#include <kos/errno.h>
int pthread_cond_signal(pthread_cond_t *cond) {
- int old, rv = 0;
+ errno_save_scoped();
- old = errno;
- if(cond_signal(&cond->cond))
- rv = errno;
-
- errno = old;
- return rv;
+ return errno_if_nonzero(cond_signal(&cond->cond));
}
diff --git a/addons/libpthread/pthread_cond_timedwait.c b/addons/libpthread/pthread_cond_timedwait.c
index 2627e987..bfd4b6c4 100644
--- a/addons/libpthread/pthread_cond_timedwait.c
+++ b/addons/libpthread/pthread_cond_timedwait.c
@@ -9,14 +9,13 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
#include <sys/time.h>
#include <kos/cond.h>
+#include <kos/errno.h>
int pthread_cond_timedwait(pthread_cond_t *__RESTRICT cond,
pthread_mutex_t *__RESTRICT mutex,
const struct timespec *__RESTRICT abstime) {
- int old, rv = 0;
int tmo;
struct timespec ctv;
@@ -26,7 +25,7 @@ int pthread_cond_timedwait(pthread_cond_t *__RESTRICT cond,
if(abstime->tv_nsec < 0 || abstime->tv_nsec > 1000000000L)
return EINVAL;
- old = errno;
+ errno_save_scoped();
/* Figure out the timeout we need to provide in milliseconds. */
clock_gettime(cond->clock_id, &ctv);
@@ -37,9 +36,5 @@ int pthread_cond_timedwait(pthread_cond_t *__RESTRICT cond,
if(tmo <= 0)
return ETIMEDOUT;
- if(cond_wait_timed(&cond->cond, &mutex->mutex, tmo))
- rv = errno;
-
- errno = old;
- return rv;
+ return errno_if_nonzero(cond_wait_timed(&cond->cond, &mutex->mutex, tmo));
}
diff --git a/addons/libpthread/pthread_cond_wait.c b/addons/libpthread/pthread_cond_wait.c
index 67d50183..d057a7b9 100644
--- a/addons/libpthread/pthread_cond_wait.c
+++ b/addons/libpthread/pthread_cond_wait.c
@@ -7,17 +7,12 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
#include <kos/cond.h>
+#include <kos/errno.h>
int pthread_cond_wait(pthread_cond_t *__RESTRICT cond,
pthread_mutex_t *__RESTRICT mutex) {
- int old, rv = 0;
+ errno_save_scoped();
- old = errno;
- if(cond_wait(&cond->cond, &mutex->mutex))
- rv = errno;
-
- errno = old;
- return rv;
+ return errno_if_nonzero(cond_wait(&cond->cond, &mutex->mutex));
}
diff --git a/addons/libpthread/pthread_mutex_destroy.c b/addons/libpthread/pthread_mutex_destroy.c
index cf7b53d1..07877726 100644
--- a/addons/libpthread/pthread_mutex_destroy.c
+++ b/addons/libpthread/pthread_mutex_destroy.c
@@ -7,16 +7,11 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/mutex.h>
int pthread_mutex_destroy(pthread_mutex_t *mutex) {
- int old, rv = 0;
+ errno_save_scoped();
- old = errno;
- if(mutex_destroy(&mutex->mutex))
- rv = errno;
-
- errno = old;
- return rv;
+ return errno_if_nonzero(mutex_destroy(&mutex->mutex));
}
diff --git a/addons/libpthread/pthread_mutex_init.c b/addons/libpthread/pthread_mutex_init.c
index 572d3d5b..57f6795e 100644
--- a/addons/libpthread/pthread_mutex_init.c
+++ b/addons/libpthread/pthread_mutex_init.c
@@ -7,13 +7,12 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/mutex.h>
int pthread_mutex_init(pthread_mutex_t *__RESTRICT mutex,
const pthread_mutexattr_t *__RESTRICT attr) {
unsigned int type = MUTEX_TYPE_NORMAL;
- int old, rv = 0;
if(attr) {
switch(attr->mtype) {
@@ -22,9 +21,6 @@ int pthread_mutex_init(pthread_mutex_t *__RESTRICT mutex,
break;
case PTHREAD_MUTEX_ERRORCHECK:
- type = MUTEX_TYPE_ERRORCHECK;
- break;
-
case PTHREAD_MUTEX_RECURSIVE:
type = MUTEX_TYPE_RECURSIVE;
break;
@@ -32,12 +28,13 @@ int pthread_mutex_init(pthread_mutex_t *__RESTRICT mutex,
default:
return EINVAL;
}
+
+ mutex->type = attr->mtype;
+ } else {
+ mutex->type = PTHREAD_MUTEX_NORMAL;
}
- old = errno;
- if(mutex_init(&mutex->mutex, type))
- rv = errno;
+ errno_save_scoped();
- errno = old;
- return rv;
+ return errno_if_nonzero(mutex_init(&mutex->mutex, type));
}
diff --git a/addons/libpthread/pthread_mutex_lock.c b/addons/libpthread/pthread_mutex_lock.c
index 89ea42ba..09eaf65d 100644
--- a/addons/libpthread/pthread_mutex_lock.c
+++ b/addons/libpthread/pthread_mutex_lock.c
@@ -7,19 +7,22 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/mutex.h>
int pthread_mutex_lock(pthread_mutex_t *mutex) {
- int old, rv = 0;
-
if(mutex->mutex.type > MUTEX_TYPE_RECURSIVE)
return EINVAL;
- old = errno;
+ errno_save_scoped();
+
if(mutex_lock(&mutex->mutex))
- rv = errno;
+ return errno;
+
+ if(mutex->type == PTHREAD_MUTEX_ERRORCHECK && mutex->mutex.count > 1) {
+ mutex_unlock(&mutex->mutex);
+ return EDEADLK;
+ }
- errno = old;
- return rv;
+ return 0;
}
diff --git a/addons/libpthread/pthread_mutex_timedlock.c b/addons/libpthread/pthread_mutex_timedlock.c
index b1ee3561..b7831a9c 100644
--- a/addons/libpthread/pthread_mutex_timedlock.c
+++ b/addons/libpthread/pthread_mutex_timedlock.c
@@ -8,13 +8,12 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
#include <sys/time.h>
+#include <kos/errno.h>
#include <kos/mutex.h>
int pthread_mutex_timedlock(pthread_mutex_t *__RESTRICT mutex,
const struct timespec *__RESTRICT abstime) {
- int old, rv = 0;
int tmo;
struct timespec ctv;
@@ -31,10 +30,10 @@ int pthread_mutex_timedlock(pthread_mutex_t *__RESTRICT mutex,
the timing... POSIX says that if the lock can be acquired immediately
then this function should never return a timeout, regardless of what
abstime says. */
- old = errno;
+ errno_save_scoped();
if(!mutex_trylock(&mutex->mutex))
- return 0;
+ goto out_check_err;
/* Figure out the timeout we need to provide in milliseconds. */
clock_gettime(CLOCK_REALTIME, &ctv);
@@ -46,8 +45,13 @@ int pthread_mutex_timedlock(pthread_mutex_t *__RESTRICT mutex,
return ETIMEDOUT;
if(mutex_lock_timed(&mutex->mutex, tmo))
- rv = errno;
+ return errno;
- errno = old;
- return rv;
+out_check_err:
+ if(mutex->type == PTHREAD_MUTEX_ERRORCHECK && mutex->mutex.count > 1) {
+ mutex_unlock(&mutex->mutex);
+ return EDEADLK;
+ }
+
+ return 0;
}
diff --git a/addons/libpthread/pthread_mutex_trylock.c b/addons/libpthread/pthread_mutex_trylock.c
index 4271483f..585f8493 100644
--- a/addons/libpthread/pthread_mutex_trylock.c
+++ b/addons/libpthread/pthread_mutex_trylock.c
@@ -7,19 +7,22 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/mutex.h>
int pthread_mutex_trylock(pthread_mutex_t *mutex) {
- int old, rv = 0;
-
if(mutex->mutex.type > MUTEX_TYPE_RECURSIVE)
return EINVAL;
- old = errno;
+ errno_save_scoped();
+
if(mutex_trylock(&mutex->mutex))
- rv = errno;
+ return errno;
+
+ if(mutex->type == PTHREAD_MUTEX_ERRORCHECK && mutex->mutex.count > 1) {
+ mutex_unlock(&mutex->mutex);
+ return EDEADLK;
+ }
- errno = old;
- return rv;
+ return 0;
}
diff --git a/addons/libpthread/pthread_mutex_unlock.c b/addons/libpthread/pthread_mutex_unlock.c
index a5d1b0c3..0d38820e 100644
--- a/addons/libpthread/pthread_mutex_unlock.c
+++ b/addons/libpthread/pthread_mutex_unlock.c
@@ -7,16 +7,16 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/mutex.h>
int pthread_mutex_unlock(pthread_mutex_t *mutex) {
- int old, rv = 0;
+ if(mutex->type == PTHREAD_MUTEX_ERRORCHECK &&
+ (mutex->mutex.count == 0 || mutex->mutex.holder != thd_get_current())) {
+ return EFAULT;
+ }
- old = errno;
- if(mutex_unlock(&mutex->mutex))
- rv = errno;
+ errno_save_scoped();
- errno = old;
- return rv;
+ return errno_if_nonzero(mutex_unlock(&mutex->mutex));
}
diff --git a/addons/libpthread/pthread_rwlock_destroy.c b/addons/libpthread/pthread_rwlock_destroy.c
index e98940d4..298fb51e 100644
--- a/addons/libpthread/pthread_rwlock_destroy.c
+++ b/addons/libpthread/pthread_rwlock_destroy.c
@@ -7,21 +7,14 @@
#include "pthread-internal.h"
#include <pthread.h>
-#include <errno.h>
+#include <kos/errno.h>
#include <kos/rwsem.h>
int pthread_rwlock_destroy(pthread_rwlock_t *rwlock) {
- int old, rv = 0;
-
if(!rwlock)
return EFAULT;
- old = errno;
-
- if(rwsem_destroy(&rwlock->rwsem)) {
- rv = errno;
- errno = old;
- }
+ errno_save_scoped();
- return rv;
+ return errno_if_nonzero(rwsem_destroy(&rwlock->rwsem));
}
diff --git a/addons/libpthread/pthread_rwlock_init.c b/addons/libpthread/pthread_rwlock_init.c
index 13b8aebf..7e891f9e 100644
--- a/addons/libpthread/pthread_rwlock_init.c
+++ b/addons/libpthread/pthread_rwlock_init.c
@@ -7,24 +7,17 @@
#include "pthread-internal.h"
#include <pthread.h>
...<truncated>...
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-18 20:04:16
|
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 0ef0a6e931f9d973637d5908b68337a8c276e699 (commit)
from 6216f5e6795f6aec3578b4387a05976e6d804327 (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 0ef0a6e931f9d973637d5908b68337a8c276e699
Author: dfchil <da...@fa...>
Date: Tue Nov 18 21:04:01 2025 +0100
dcload: Fix wrong command sent for dcload_lseek (#1241)
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/dcload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/arch/dreamcast/hardware/dcload.c b/kernel/arch/dreamcast/hardware/dcload.c
index 8e50acf8..4c68f9a2 100644
--- a/kernel/arch/dreamcast/hardware/dcload.c
+++ b/kernel/arch/dreamcast/hardware/dcload.c
@@ -73,7 +73,7 @@ int dcload_chmod(const char *path, mode_t mode) {
}
off_t dcload_lseek(uint32_t hnd, off_t offset, int whence) {
- return (off_t)dcload_syscall(DCLOAD_READ, (void *)hnd, (void *)offset, (void *)whence);
+ return (off_t)dcload_syscall(DCLOAD_LSEEK, (void *)hnd, (void *)offset, (void *)whence);
}
int dcload_fstat(int fildes, dcload_stat_t *buf) {
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-18 20:02:24
|
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 6216f5e6795f6aec3578b4387a05976e6d804327 (commit)
from 7ffb61cf845bf2e470f1baa47531937f1a447c95 (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 6216f5e6795f6aec3578b4387a05976e6d804327
Author: DC-SWAT <sw...@21...>
Date: Sun Nov 16 23:23:51 2025 +0700
g1ata: Do not switch the bus to Master on NAOMI.
There is no need to switch to the master device (no syscalls for GD-ROM) on NAOMI, and by some reason this causes issues in the operation of the slave device.
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/g1ata.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/kernel/arch/dreamcast/hardware/g1ata.c b/kernel/arch/dreamcast/hardware/g1ata.c
index b6716b80..977d84a4 100644
--- a/kernel/arch/dreamcast/hardware/g1ata.c
+++ b/kernel/arch/dreamcast/hardware/g1ata.c
@@ -18,6 +18,7 @@
#include <kos/thread.h>
#include <kos/timer.h>
+#include <arch/arch.h>
#include <arch/cache.h>
#include <arch/irq.h>
#include <arch/memory.h>
@@ -218,7 +219,9 @@ inline int g1_ata_mutex_lock(void) {
inline int g1_ata_mutex_unlock(void) {
/* Make sure to select the GD-ROM drive back. */
- g1_ata_select_device(G1_ATA_MASTER);
+ if(hardware_sys_mode(NULL) == HW_TYPE_RETAIL) {
+ g1_ata_select_device(G1_ATA_MASTER);
+ }
return mutex_unlock(&_g1_ata_mutex);
}
@@ -250,7 +253,9 @@ static void g1_dma_done(void) {
dma_in_progress = 0;
/* Make sure to select the GD-ROM drive back. */
- g1_ata_select_device(G1_ATA_MASTER);
+ if(hardware_sys_mode(NULL) == HW_TYPE_RETAIL) {
+ g1_ata_select_device(G1_ATA_MASTER);
+ }
mutex_unlock_as_thread(&_g1_ata_mutex, dma_thd);
}
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-18 20:01:33
|
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 7ffb61cf845bf2e470f1baa47531937f1a447c95 (commit)
from de597f67ecd691074c2b843b14db6a2cb2132a66 (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 7ffb61cf845bf2e470f1baa47531937f1a447c95
Author: QuzarDC <qu...@co...>
Date: Sat Nov 15 13:43:16 2025 -0500
examples: Prevent race condition in reentrant mutex thread labels.
Before the output would print `Hello from thread unnamed!` if it
happened to be that the thread routine ran before the call to
set the thread label. By having that be passed in on thread creation
the label is guaranteed to always be present at the time of that print.
-----------------------------------------------------------------------
Summary of changes:
.../basic/threading/reentrant_mutex/reentrant_mutex.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/examples/dreamcast/basic/threading/reentrant_mutex/reentrant_mutex.c b/examples/dreamcast/basic/threading/reentrant_mutex/reentrant_mutex.c
index 29a3d93f..32d9d1b7 100644
--- a/examples/dreamcast/basic/threading/reentrant_mutex/reentrant_mutex.c
+++ b/examples/dreamcast/basic/threading/reentrant_mutex/reentrant_mutex.c
@@ -168,6 +168,9 @@ static void *thread_func(void *arg) {
int main(int argc, const char* argv[]) {
kthread_t *threads[THREAD_COUNT];
+
+ char thd_label[16];
+ kthread_attr_t attrs = { .label = thd_label };
/* Initialize our mutex */
reentrant_mutex_init(&rmutex);
@@ -175,12 +178,10 @@ int main(int argc, const char* argv[]) {
/* Spawn a bunch of threads, potentially yielding the main thread after
each one gets spawned. */
for(size_t i = 0; i < THREAD_COUNT; ++i) {
- threads[i] = thd_create(false, thread_func, NULL);
-
- char thd_label[16];
snprintf(thd_label, sizeof(thd_label), "%u", i);
- thd_set_label(threads[i], thd_label);
-
+
+ threads[i] = thd_create_ex(&attrs, thread_func, NULL);
+
maybe_pass();
}
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-08 21:40: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 de597f67ecd691074c2b843b14db6a2cb2132a66 (commit)
from cfb65791be19b9fb9919c261f6e175157a1f2ed2 (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 de597f67ecd691074c2b843b14db6a2cb2132a66
Author: Paul Cercueil <pa...@cr...>
Date: Thu Nov 6 11:47:45 2025 +0100
pvr: Update pvr_vertex_t to support modified non-textured polys
Modified non-textured polys don't use the argb/oargb fields, they
instead use the fields that are normally occupied by U/V coordinates to
store the argb color for the outside and inside areas.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/include/dc/pvr.h | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/arch/dreamcast/include/dc/pvr.h b/kernel/arch/dreamcast/include/dc/pvr.h
index 30aa14c3..fdefed98 100644
--- a/kernel/arch/dreamcast/include/dc/pvr.h
+++ b/kernel/arch/dreamcast/include/dc/pvr.h
@@ -659,8 +659,16 @@ typedef struct pvr_vertex {
float x; /**< \brief X coordinate */
float y; /**< \brief Y coordinate */
float z; /**< \brief Z coordinate */
- float u; /**< \brief Texture U coordinate */
- float v; /**< \brief Texture V coordinate */
+ union {
+ struct {
+ float u; /**< \brief Texture U coordinate */
+ float v; /**< \brief Texture V coordinate */
+ };
+ struct {
+ uint32_t argb0; /**< \brief Vertex color when modified, outside area */
+ uint32_t argb1; /**< \brief Vertex color when modified, inside area */
+ };
+ };
uint32_t argb; /**< \brief Vertex color */
uint32_t oargb; /**< \brief Vertex offset color */
} pvr_vertex_t;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-08 21:38: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 cfb65791be19b9fb9919c261f6e175157a1f2ed2 (commit)
from 037831d2ff0f954bb4020d0119047a5738e7fc04 (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 cfb65791be19b9fb9919c261f6e175157a1f2ed2
Author: Paul Cercueil <pa...@cr...>
Date: Fri Oct 24 12:13:27 2025 +0200
pvr: Add function pvr_get_back_buffer()
Similar to pvr_get_front_buffer(), this function can be used to retrieve
a VRAM pointer to the back buffer.
Since the back buffer is only written after the current scene is
finished, it is actually possible to use the back buffer as a background
texture (similar to how the front buffer is used as a texture in the
fb_tex example) for doing additive double-buffering rendering, where the
background of each frame N is the frame N-2.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/pvr/pvr_misc.c | 12 ++++++++++--
kernel/arch/dreamcast/include/dc/pvr.h | 14 ++++++++++++++
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
index eff80f2e..bada5adc 100644
--- a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
+++ b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
@@ -266,7 +266,7 @@ void pvr_blank_polyhdr_buf(int type, pvr_poly_hdr_t * poly) {
poly->cmd = FIELD_PREP(PVR_TA_CMD_TYPE, type) | 0x80840012;
}
-pvr_ptr_t pvr_get_front_buffer(void) {
+static pvr_ptr_t pvr_get_frame_buffer(bool back) {
unsigned int idx;
uint32_t addr;
@@ -275,7 +275,7 @@ pvr_ptr_t pvr_get_front_buffer(void) {
/* The front buffer may not have been fully rendered or submitted to the
video hardware yet. In case this has yet to happen, we want the second
view target, aka. the one not currently being displayed. */
- idx = pvr_state.view_target ^ pvr_state.render_completed;
+ idx = pvr_state.view_target ^ pvr_state.render_completed ^ back;
addr = pvr_state.frame_buffers[idx].frame & (PVR_RAM_SIZE - 1);
@@ -284,6 +284,14 @@ pvr_ptr_t pvr_get_front_buffer(void) {
return (pvr_ptr_t)(addr * 2 + PVR_RAM_BASE);
}
+pvr_ptr_t pvr_get_front_buffer(void) {
+ return pvr_get_frame_buffer(false);
+}
+
+pvr_ptr_t pvr_get_back_buffer(void) {
+ return pvr_get_frame_buffer(true);
+}
+
int pvr_set_vertical_scale(float factor) {
uint32_t f16;
uint32_t cfg;
diff --git a/kernel/arch/dreamcast/include/dc/pvr.h b/kernel/arch/dreamcast/include/dc/pvr.h
index 7130d3e0..30aa14c3 100644
--- a/kernel/arch/dreamcast/include/dc/pvr.h
+++ b/kernel/arch/dreamcast/include/dc/pvr.h
@@ -1603,6 +1603,20 @@ void pvr_poly_cxt_txr_mod(pvr_poly_cxt_t *dst, pvr_list_t list,
*/
pvr_ptr_t pvr_get_front_buffer(void);
+/** \brief Get a pointer to the back buffer.
+ \ingroup pvr_txr_mgmt
+
+ This function can be used to retrieve a pointer to the back buffer, aka.
+ the frame buffer that will be rendered to.
+
+ Note that the frame buffers lie in 32-bit memory, while textures lie in
+ 64-bit memory. The address returned will point to 64-bit memory, but the
+ back buffer cannot be used directly as a regular texture.
+
+ \return A pointer to the back buffer.
+*/
+pvr_ptr_t pvr_get_back_buffer(void);
+
/*********************************************************************/
#include "pvr/pvr_regs.h"
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-08 21:37:01
|
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 037831d2ff0f954bb4020d0119047a5738e7fc04 (commit)
via 4efb138265955450a4c5d1b1562481889bb099eb (commit)
via f7d97b50a4411a0e9c824bbad761e1663ade2ec4 (commit)
from cacf38ee9915fda00c4158c381727c5e7ce11e42 (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 037831d2ff0f954bb4020d0119047a5738e7fc04
Author: darc <da...@pr...>
Date: Wed Nov 5 23:14:13 2025 -0600
Update dc-chain changelog
commit 4efb138265955450a4c5d1b1562481889bb099eb
Author: darc <da...@pr...>
Date: Wed Nov 5 23:09:55 2025 -0600
Decouple GDB compilation from profiles and always build 16.3 (latest)
commit f7d97b50a4411a0e9c824bbad761e1663ade2ec4
Author: darc <da...@pr...>
Date: Wed Nov 5 23:08:44 2025 -0600
Prevent GDB compilation errors by adding `--Wno-error=incompatible-pointer-types` to the build
-----------------------------------------------------------------------
Summary of changes:
utils/dc-chain/Makefile | 3 +++
utils/dc-chain/doc/CHANGELOG.md | 1 +
utils/dc-chain/profiles/aica/stable.mk | 1 -
utils/dc-chain/profiles/dreamcast/13.4.0.mk | 1 -
utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk | 1 -
utils/dc-chain/profiles/dreamcast/14.3.0.mk | 1 -
utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk | 1 -
utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk | 1 -
utils/dc-chain/profiles/dreamcast/15.2.0.mk | 1 -
utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk | 1 -
utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk | 1 -
utils/dc-chain/profiles/dreamcast/9.5.0-winxp.mk | 1 -
utils/dc-chain/profiles/dreamcast/stable.mk | 1 -
utils/dc-chain/profiles/gamecube/stable.mk | 1 -
utils/dc-chain/{scripts/logdir.mk => profiles/gdb.mk} | 3 +--
utils/dc-chain/scripts/gdb.mk | 1 +
16 files changed, 6 insertions(+), 14 deletions(-)
copy utils/dc-chain/{scripts/logdir.mk => profiles/gdb.mk} (73%)
diff --git a/utils/dc-chain/Makefile b/utils/dc-chain/Makefile
index 27cc8bc3..7519cbdd 100644
--- a/utils/dc-chain/Makefile
+++ b/utils/dc-chain/Makefile
@@ -30,6 +30,9 @@ else
$(error No toolchain profile file found at profiles/$(platform)/$(toolchain_profile).mk)
endif
+# GDB version
+include profiles/gdb.mk
+
# Download functions
include scripts/utils.mk
diff --git a/utils/dc-chain/doc/CHANGELOG.md b/utils/dc-chain/doc/CHANGELOG.md
index e8aceb4e..01e295ae 100644
--- a/utils/dc-chain/doc/CHANGELOG.md
+++ b/utils/dc-chain/doc/CHANGELOG.md
@@ -2,6 +2,7 @@
| Date<br/>_____________ | Author(s)<br/>_____________ | Changes<br/>_____________ |
|:-----------------------|:----------------------------|---------------------------|
+| 2025-11-05 | Eric Fradella | Decouple compiled GDB version from toolchain profile |
| 2025-08-03 | Eric Fradella | Update 15.x profiles to 15.2.0/15.2.1-dev. All dev profiles upgraded to Binutils 2.45 and GDB 16.3 |
| 2025-07-13 | Paul Cercueil | Add new profile for the LRA development toolchain |
| 2025-07-13 | Paul Cercueil | Re-introduce ARM toolchain support |
diff --git a/utils/dc-chain/profiles/aica/stable.mk b/utils/dc-chain/profiles/aica/stable.mk
index b6674548..3c7e4854 100644
--- a/utils/dc-chain/profiles/aica/stable.mk
+++ b/utils/dc-chain/profiles/aica/stable.mk
@@ -9,7 +9,6 @@ cpu_configure_args=--with-arch=armv4 --with-mode=arm --disable-multilib
binutils_ver=2.45
gcc_ver=8.5.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
diff --git a/utils/dc-chain/profiles/dreamcast/13.4.0.mk b/utils/dc-chain/profiles/dreamcast/13.4.0.mk
index 6cc82d44..d8f3a5b6 100644
--- a/utils/dc-chain/profiles/dreamcast/13.4.0.mk
+++ b/utils/dc-chain/profiles/dreamcast/13.4.0.mk
@@ -9,7 +9,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.44
gcc_ver=13.4.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
diff --git a/utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk b/utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk
index 6aad0c4f..5d9e8e62 100644
--- a/utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk
@@ -16,7 +16,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.45
gcc_ver=13.4.1
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# Overide SH toolchain download type
gcc_download_type=git
diff --git a/utils/dc-chain/profiles/dreamcast/14.3.0.mk b/utils/dc-chain/profiles/dreamcast/14.3.0.mk
index 03fe162d..389d3acb 100644
--- a/utils/dc-chain/profiles/dreamcast/14.3.0.mk
+++ b/utils/dc-chain/profiles/dreamcast/14.3.0.mk
@@ -9,7 +9,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.44
gcc_ver=14.3.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
diff --git a/utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk b/utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk
index 3d3ec9ce..6a74a49f 100644
--- a/utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk
@@ -16,7 +16,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.45
gcc_ver=14.3.1
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# Overide SH toolchain download type
gcc_download_type=git
diff --git a/utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk b/utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk
index 16f45fe7..a75b1523 100644
--- a/utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk
+++ b/utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk
@@ -16,7 +16,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.45
gcc_ver=15.0.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# Overide SH toolchain download type
gcc_download_type=git
diff --git a/utils/dc-chain/profiles/dreamcast/15.2.0.mk b/utils/dc-chain/profiles/dreamcast/15.2.0.mk
index 98e17bb7..d85de908 100644
--- a/utils/dc-chain/profiles/dreamcast/15.2.0.mk
+++ b/utils/dc-chain/profiles/dreamcast/15.2.0.mk
@@ -9,7 +9,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.45
gcc_ver=15.2.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
diff --git a/utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk b/utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk
index bc20df68..72e99d90 100644
--- a/utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk
@@ -16,7 +16,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.45
gcc_ver=15.2.1
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# Overide SH toolchain download type
gcc_download_type=git
diff --git a/utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk b/utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk
index e612f905..0f0055dc 100644
--- a/utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk
@@ -16,7 +16,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.45
gcc_ver=16.0.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# Overide SH toolchain download type
gcc_download_type=git
diff --git a/utils/dc-chain/profiles/dreamcast/9.5.0-winxp.mk b/utils/dc-chain/profiles/dreamcast/9.5.0-winxp.mk
index 0469bec7..5054bc8c 100644
--- a/utils/dc-chain/profiles/dreamcast/9.5.0-winxp.mk
+++ b/utils/dc-chain/profiles/dreamcast/9.5.0-winxp.mk
@@ -9,7 +9,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.34
gcc_ver=9.5.0
newlib_ver=4.3.0.20230120
-gdb_ver=15.2
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
diff --git a/utils/dc-chain/profiles/dreamcast/stable.mk b/utils/dc-chain/profiles/dreamcast/stable.mk
index 1c3d7b97..2e9a10a2 100644
--- a/utils/dc-chain/profiles/dreamcast/stable.mk
+++ b/utils/dc-chain/profiles/dreamcast/stable.mk
@@ -9,7 +9,6 @@ cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little
binutils_ver=2.43
gcc_ver=13.2.0
newlib_ver=4.3.0.20230120
-gdb_ver=15.2
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
diff --git a/utils/dc-chain/profiles/gamecube/stable.mk b/utils/dc-chain/profiles/gamecube/stable.mk
index 9f34b7bc..71509aa3 100644
--- a/utils/dc-chain/profiles/gamecube/stable.mk
+++ b/utils/dc-chain/profiles/gamecube/stable.mk
@@ -10,7 +10,6 @@ newlib_extra_configure_args += --disable-libgloss
binutils_ver=2.45
gcc_ver=15.2.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.3
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
diff --git a/utils/dc-chain/scripts/logdir.mk b/utils/dc-chain/profiles/gdb.mk
similarity index 73%
copy from utils/dc-chain/scripts/logdir.mk
copy to utils/dc-chain/profiles/gdb.mk
index dac651bb..7f6ccfb8 100644
--- a/utils/dc-chain/scripts/logdir.mk
+++ b/utils/dc-chain/profiles/gdb.mk
@@ -1,5 +1,4 @@
# Sega Dreamcast Toolchains Maker (dc-chain)
# This file is part of KallistiOS.
-logdir:
- @mkdir -p $(logdir)
+gdb_ver ?= 16.3
diff --git a/utils/dc-chain/scripts/gdb.mk b/utils/dc-chain/scripts/gdb.mk
index 55c03ad1..cc8b16ff 100644
--- a/utils/dc-chain/scripts/gdb.mk
+++ b/utils/dc-chain/scripts/gdb.mk
@@ -49,6 +49,7 @@ $(stamp_gdb_build): patch_gdb
--target=$(target) \
CC="$(CC)" \
CXX="$(CXX)" \
+ CFLAGS="$(CFLAGS) -Wno-error=incompatible-pointer-types" \
$(macos_gdb_configure_args) \
$(static_flag) \
$(to_log)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-02 20:07:47
|
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 cacf38ee9915fda00c4158c381727c5e7ce11e42 (commit)
via 772a117830f3d6993d7b8fd2fae3b0b3a4513430 (commit)
via 0dc220f323c883daa8b7e892a026b4ead19149eb (commit)
via cf46e2d0b5f44ca364f669d5775ce6b1d6c4fc28 (commit)
via fcecd3733fc87bbd37a3985b56d2b21230fa2090 (commit)
via c4172c57772036732e17111e2868543734aa60f2 (commit)
from fab88066d4176b37d037b9d28af82d87589cd145 (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 cacf38ee9915fda00c4158c381727c5e7ce11e42
Author: DC-SWAT <sw...@21...>
Date: Thu Oct 30 14:18:57 2025 +0700
[arch] Cached hardware_sys_mode().
commit 772a117830f3d6993d7b8fd2fae3b0b3a4513430
Author: DC-SWAT <sw...@21...>
Date: Thu Oct 30 14:10:58 2025 +0700
[sci] Used hardware_sys_mode() for CS pin selection.
commit 0dc220f323c883daa8b7e892a026b4ead19149eb
Author: DC-SWAT <sw...@21...>
Date: Thu Oct 30 14:10:43 2025 +0700
[video] Used hardware_sys_mode() for cable detection.
commit cf46e2d0b5f44ca364f669d5775ce6b1d6c4fc28
Author: DC-SWAT <sw...@21...>
Date: Thu Oct 30 14:09:57 2025 +0700
[aica] Used hardware_sys_mode() for memory size detection.
commit fcecd3733fc87bbd37a3985b56d2b21230fa2090
Author: DC-SWAT <sw...@21...>
Date: Thu Oct 30 14:09:44 2025 +0700
[pvr] Used hardware_sys_mode() for memory size detection.
commit c4172c57772036732e17111e2868543734aa60f2
Author: DC-SWAT <sw...@21...>
Date: Fri Oct 24 11:30:13 2025 +0700
[arch] Add HW_TYPE_NAOMI for hardware_sys_mode().
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/hardware.c | 8 ++++----
kernel/arch/dreamcast/hardware/sci.c | 18 ++++++++++--------
kernel/arch/dreamcast/hardware/video.c | 2 +-
kernel/arch/dreamcast/include/arch/arch.h | 3 +++
kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h | 6 +++---
kernel/arch/dreamcast/sound/snd_mem.c | 12 +++++++++---
6 files changed, 30 insertions(+), 19 deletions(-)
diff --git a/kernel/arch/dreamcast/hardware/hardware.c b/kernel/arch/dreamcast/hardware/hardware.c
index 9b1ad726..d5dd4532 100644
--- a/kernel/arch/dreamcast/hardware/hardware.c
+++ b/kernel/arch/dreamcast/hardware/hardware.c
@@ -19,16 +19,15 @@
#include <dc/vblank.h>
static int initted = 0;
+static uint32_t sysmode;
#define SYSMODE_REG 0xA05F74B0
int hardware_sys_mode(int *region) {
- uint32 sm = *((vuint32 *)SYSMODE_REG);
-
if(region)
- *region = sm & 0x0F;
+ *region = sysmode & 0x0F;
- return (sm >> 4) & 0x0F;
+ return (sysmode >> 4) & 0x0F;
}
int hardware_sys_init(void) {
@@ -38,6 +37,7 @@ int hardware_sys_init(void) {
/* VBlank multiplexer */
vblank_init();
+ sysmode = *((volatile uint32_t *)SYSMODE_REG);
initted = 1;
return 0;
diff --git a/kernel/arch/dreamcast/hardware/sci.c b/kernel/arch/dreamcast/hardware/sci.c
index 8b839880..cf117b81 100644
--- a/kernel/arch/dreamcast/hardware/sci.c
+++ b/kernel/arch/dreamcast/hardware/sci.c
@@ -6,6 +6,7 @@
#include <dc/sci.h>
#include <dc/math.h>
+#include <arch/arch.h>
#include <arch/cache.h>
#include <arch/dmac.h>
#include <kos/timer.h>
@@ -333,14 +334,15 @@ sci_result_t sci_init(uint32_t baud_rate, sci_mode_t mode, sci_clock_t clock_src
else if(mode == SCI_MODE_SPI) {
/* Use 512 bytes DMA buffer for SPI operations by default,
because it's sector size of SD cards. */
-#ifdef __DREAMCAST__
- /* On Dreamcast, we use GPIO for CS (anyway need soldering all pins),
- because RTS can be used for VS-link cable */
- sci_configure_spi(SCI_SPI_CS_GPIO, 512);
-#else
- /* On Naomi, we use SCIF RTS for CS, because no GPIO pins on CN1 connector */
- sci_configure_spi(SCI_SPI_CS_RTS, 512);
-#endif
+ if(hardware_sys_mode(NULL) == HW_TYPE_RETAIL) {
+ /* On Dreamcast, we use GPIO for CS (anyway need soldering all pins),
+ because RTS can be used for VS-link cable */
+ sci_configure_spi(SCI_SPI_CS_GPIO, 512);
+ }
+ else {
+ /* On NAOMI, we use SCIF RTS for CS, because no GPIO pins on CN1 connector */
+ sci_configure_spi(SCI_SPI_CS_RTS, 512);
+ }
/* Set CA bit for 8-bit synchronous mode */
scsmr1 |= SCSMR_CA;
}
diff --git a/kernel/arch/dreamcast/hardware/video.c b/kernel/arch/dreamcast/hardware/video.c
index b5f69ce4..96c585cd 100644
--- a/kernel/arch/dreamcast/hardware/video.c
+++ b/kernel/arch/dreamcast/hardware/video.c
@@ -211,7 +211,7 @@ uint32_t *vram_l;
int8_t vid_check_cable(void) {
volatile uint32_t * porta = (vuint32 *)0xff80002c;
- if(KOS_PLATFORM_IS_NAOMI) {
+ if(hardware_sys_mode(NULL) != HW_TYPE_RETAIL) {
/* XXXX: This still needs to be figured out for NAOMI. For now, assume
VGA mode. */
return CT_VGA;
diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h
index a152d691..39c20aa1 100644
--- a/kernel/arch/dreamcast/include/arch/arch.h
+++ b/kernel/arch/dreamcast/include/arch/arch.h
@@ -253,6 +253,7 @@ void hardware_shutdown(void);
*/
#define HW_TYPE_RETAIL 0x0 /**< \brief A retail Dreamcast. */
#define HW_TYPE_SET5 0x9 /**< \brief A Set5.xx devkit. */
+#define HW_TYPE_NAOMI 0xa /**< \brief A NAOMI arcade. */
/** @} */
/** \defgroup hw_regions Region Codes
@@ -290,6 +291,8 @@ void hardware_shutdown(void);
-- otherwise, you must retrieve the region from the
flashrom.
\return The console type (one of the \ref hw_consoles).
+
+ \note Do not use before hardware_sys_init() has been called.
*/
int hardware_sys_mode(int *region);
diff --git a/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h b/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h
index 10076d6e..2b4981b0 100644
--- a/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h
+++ b/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h
@@ -3,7 +3,7 @@
dc/pvr/pvr_regs.h
Copyright (C) 2002 Megan Potter
Copyright (C) 2014 Lawrence Sebald
- Copyright (C) 2023 Ruslan Rostovtsev
+ Copyright (C) 2023, 2025 Ruslan Rostovtsev
Copyright (C) 2024 Falco Girgis
*/
@@ -30,7 +30,7 @@
#include <kos/cdefs.h>
__BEGIN_DECLS
-#include <kos/platform.h>
+#include <arch/arch.h>
/**** Register macros ***************************************************/
@@ -175,7 +175,7 @@ __BEGIN_DECLS
#define PVR_RAM_BASE 0xa5000000 /**< \brief VRAM 32-bit, P2 area, PVR->VRAM */
#define PVR_RAM_INT_BASE 0xa4000000 /**< \brief VRAM 64-bit, P2 area, PVR->VRAM */
-#define PVR_RAM_SIZE_MB (KOS_PLATFORM_IS_NAOMI ? 16 : 8) /**< \brief RAM size in MiB */
+#define PVR_RAM_SIZE_MB (hardware_sys_mode(NULL) == HW_TYPE_RETAIL ? 8 : 16) /**< \brief RAM size in MiB */
#define PVR_RAM_SIZE (PVR_RAM_SIZE_MB*1024*1024) /**< \brief RAM size in bytes */
#define PVR_RAM_TOP (PVR_RAM_BASE + PVR_RAM_SIZE) /**< \brief Top of raw PVR RAM */
diff --git a/kernel/arch/dreamcast/sound/snd_mem.c b/kernel/arch/dreamcast/sound/snd_mem.c
index cba2494c..5344d147 100644
--- a/kernel/arch/dreamcast/sound/snd_mem.c
+++ b/kernel/arch/dreamcast/sound/snd_mem.c
@@ -2,7 +2,7 @@
snd_mem.c
Copyright (C) 2002 Megan Potter
- Copyright (C) 2023 Ruslan Rostovtsev
+ Copyright (C) 2023, 2025 Ruslan Rostovtsev
*/
@@ -13,6 +13,7 @@
#include <errno.h>
#include <sys/queue.h>
#include <dc/sound/sound.h>
+#include <arch/arch.h>
#include <arch/spinlock.h>
#include <kos/dbglog.h>
@@ -94,7 +95,12 @@ int snd_mem_init(uint32 reserve) {
memset(blk, 0, sizeof(snd_block_t));
blk->addr = reserve;
- blk->size = 2 * 1024 * 1024 - reserve;
+
+ if(hardware_sys_mode(NULL) == HW_TYPE_RETAIL)
+ blk->size = 2 * 1024 * 1024 - reserve;
+ else
+ blk->size = 8 * 1024 * 1024 - reserve;
+
blk->inuse = 0;
TAILQ_INSERT_HEAD(&pool, blk, qent);
@@ -137,7 +143,7 @@ void snd_mem_shutdown(void) {
/* Allocate a chunk of SPU RAM; we will return an offset into SPU RAM. */
uint32 snd_mem_malloc(size_t size) {
snd_block_t *e, *best = NULL;
- size_t best_size = 4 * 1024 * 1024;
+ size_t best_size = SIZE_MAX;
assert_msg(initted, "Use of snd_mem_malloc before snd_mem_init");
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-11-01 05:32:40
|
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 fab88066d4176b37d037b9d28af82d87589cd145 (commit)
from 6e42550a3e06a960e16e248ea48eae53fe20e5cb (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 fab88066d4176b37d037b9d28af82d87589cd145
Author: Paul Cercueil <pa...@cr...>
Date: Sat Oct 25 11:57:03 2025 +0200
fs: Fix use of uninitialized variable
The 'idx' field was not initialized when opening a directory, which
caused fs_readdir() to behave erratically.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
kernel/fs/fs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/fs/fs.c b/kernel/fs/fs.c
index c2c3395d..d224a834 100644
--- a/kernel/fs/fs.c
+++ b/kernel/fs/fs.c
@@ -155,6 +155,7 @@ static fs_hnd_t * fs_hnd_open(const char *fn, int mode) {
hnd->handler = cur;
hnd->hnd = h;
hnd->refcnt = 0;
+ hnd->idx = 0;
return hnd;
}
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-19 05:01:53
|
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 6e42550a3e06a960e16e248ea48eae53fe20e5cb (commit)
from 86a2f34e0a5fe1e5ae877f766505aa70e614d1a4 (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 6e42550a3e06a960e16e248ea48eae53fe20e5cb
Author: QuzarDC <qu...@co...>
Date: Sat Sep 27 08:41:05 2025 -0400
kos-cc: Don't apply verbose output to version check.
As `KOS_GCCVER` relies on the output of `kos-cc -dumpversion`
being just the singular value, enabling `KOS_WRAPPERS_VERBOSE`
breaks the checking that it does by echoing the call ahead
of the output. To avoid this we have a separate use mode for
the dumpversion flag which ignores the request for verbose
output.
-----------------------------------------------------------------------
Summary of changes:
utils/build_wrappers/kos-cc | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/utils/build_wrappers/kos-cc b/utils/build_wrappers/kos-cc
index 7365aa09..642a49a2 100755
--- a/utils/build_wrappers/kos-cc
+++ b/utils/build_wrappers/kos-cc
@@ -20,6 +20,11 @@ for i in $ARGS; do
# a better way to do this. (scan for any .c?)
USEMODE=3
;;
+ -dumpversion)
+ # Used for our gcc version test which expects
+ # *just* the output and no verbose output.
+ USEMODE=4
+ ;;
*)
;;
esac
@@ -57,4 +62,9 @@ case $USEMODE in
fi
exec ${KOS_CC} ${KOS_CFLAGS} "$@"
;;
+
+ 4)
+ # -dumpversion mode. Ignore verbose.
+ exec ${KOS_CC} "$@"
+ ;;
esac
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-19 05:01:07
|
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 86a2f34e0a5fe1e5ae877f766505aa70e614d1a4 (commit)
from 7bf0e0329b23482eae9f5231f39a0843dee407c7 (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 86a2f34e0a5fe1e5ae877f766505aa70e614d1a4
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 21:42:15 2025 -0400
thread: Constify accessor params.
None modify the contents of what is being accessed.
Note that `thd_get_cpu_time` doesn't qualify as it
will attempt to update the time if being called on
the current thread. Neither do `thd_get_errno` or
`thd_get_reent` as the return would discard the
qualifier.
-----------------------------------------------------------------------
Summary of changes:
include/kos/thread.h | 8 ++++----
kernel/thread/thread.c | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/kos/thread.h b/include/kos/thread.h
index e0b8f9c6..b0124e9e 100644
--- a/include/kos/thread.h
+++ b/include/kos/thread.h
@@ -531,7 +531,7 @@ int thd_set_prio(kthread_t *thd, prio_t prio);
\sa thd_set_prio
*/
-prio_t thd_get_prio(kthread_t *thd);
+prio_t thd_get_prio(const kthread_t *thd);
/** \brief Retrieve a thread's numeric identifier.
\relatesalso kthread_t
@@ -541,7 +541,7 @@ prio_t thd_get_prio(kthread_t *thd);
\return The identifier of the thread
*/
-tid_t thd_get_id(kthread_t *thd);
+tid_t thd_get_id(const kthread_t *thd);
/** \brief Retrieve the current thread's kthread struct.
\relatesalso kthread_t
@@ -559,7 +559,7 @@ kthread_t *thd_get_current(void);
\sa thd_set_label
*/
-const char *thd_get_label(kthread_t *thd);
+const char *thd_get_label(const kthread_t *thd);
/** \brief Set the thread's label.
\relatesalso kthread_t
@@ -590,7 +590,7 @@ void thd_set_label(kthread_t *__RESTRICT thd, const char *__RESTRICT label);
\sa thd_set_pd
*/
-const char *thd_get_pwd(kthread_t *thd);
+const char *thd_get_pwd(const kthread_t *thd);
/** \brief Set the thread's current working directory.
\relatesalso kthread_t
diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c
index 743d0cf2..aeccf3a1 100644
--- a/kernel/thread/thread.c
+++ b/kernel/thread/thread.c
@@ -568,14 +568,14 @@ int thd_set_prio(kthread_t *thd, prio_t prio) {
return 0;
}
-prio_t thd_get_prio(kthread_t *thd) {
+prio_t thd_get_prio(const kthread_t *thd) {
if(!thd)
thd = thd_current;
return thd->prio;
}
-tid_t thd_get_id(kthread_t *thd) {
+tid_t thd_get_id(const kthread_t *thd) {
if(!thd)
thd = thd_current;
@@ -873,7 +873,7 @@ int thd_detach(kthread_t *thd) {
/*****************************************************************************/
/* Retrieve / set thread label */
-const char *thd_get_label(kthread_t *thd) {
+const char *thd_get_label(const kthread_t *thd) {
if(!thd)
thd = thd_current;
@@ -893,7 +893,7 @@ kthread_t *thd_get_current(void) {
}
/* Retrieve / set thread pwd */
-const char *thd_get_pwd(kthread_t *thd) {
+const char *thd_get_pwd(const kthread_t *thd) {
if(!thd)
thd = thd_current;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-11 17:37:20
|
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 7bf0e0329b23482eae9f5231f39a0843dee407c7 (commit)
from d5f06d52f7b32af94c49ebf740d55ab0e7487967 (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 7bf0e0329b23482eae9f5231f39a0843dee407c7
Author: Paul Cercueil <pa...@cr...>
Date: Sat Oct 11 19:23:31 2025 +0200
CI: Temporarily disable exclusion rule for Markdown files
This was added late and is buggy as it causes the toolchain to be built
always, even for pull requests that don't touch any toolchain-related or
CI-related files.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
.github/workflows/autobuild.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml
index c0d31726..35e3d9a0 100644
--- a/.github/workflows/autobuild.yml
+++ b/.github/workflows/autobuild.yml
@@ -52,7 +52,6 @@ jobs:
- .github/workflows/build-kos.sh
- .github/workflows/list-profiles.sh
- utils/dc-chain/**
- - '!**/*.md'
- name: build-toolchain
if: steps.filter.outputs.paths == 'true'
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-11 17:04:42
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via d5f06d52f7b32af94c49ebf740d55ab0e7487967 (commit)
via b5e4fada28fd073fe85b4d6b22527851c9deb2ce (commit)
via c0e554920353b16b272f3aef2889040aacc6fb0e (commit)
via 8c1c79603c5be611f0cb83039b222a2389fda820 (commit)
via ed2fd5eec43b586c4217fce7f455d5807fe7b3e3 (commit)
via fd6e66dfa66a408afea03494735bd73eb490aa15 (commit)
via e8d2f25ac887164ed55c452c31464e23a8d6919e (commit)
from 37b3e38e701109afc0add0158fed74b3398ff1f3 (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 d5f06d52f7b32af94c49ebf740d55ab0e7487967
Author: Paul Cercueil <pa...@cr...>
Date: Mon May 26 15:31:01 2025 +0200
CI: Add autobuilder for KallistiOS
Build all the toolchains we have a profile for, as Docker images.
The toolchains are only built when toolchain-specific or CI files
change, which means that they are only rebuilt when needed.
In a second step, those toolchains are used to build KallistiOS itself.
When the toolchains don't need to be updated, only KallistiOS is built,
which is extremely fast (around 2 minutes vs. 40+ minutes for a full
build).
When a PR is merged to the master branch, and the toolchains need to be
updated, the Docker images will be pushed to Docker Hub, which is used
to host the latest toolchain images.
Those toolchain images will be automatically downloaded and used in the
case where only KallistiOS is built.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit b5e4fada28fd073fe85b4d6b22527851c9deb2ce
Author: Paul Cercueil <pa...@cr...>
Date: Sun Aug 24 22:33:38 2025 +0200
dc-chain: docker: Install coreutils
The AICA toolchain needs the coreutils version of sha512sum to verify
the integrity of downloaded packages.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit c0e554920353b16b272f3aef2889040aacc6fb0e
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 6 10:30:21 2025 +0200
docker: Rename 'dc_chain' argument to 'profile'
The name 'dc_chain' was not very descriptive, and also insinuates that
the Docker file is only for building Dreamcast toolchains.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 8c1c79603c5be611f0cb83039b222a2389fda820
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 6 00:23:25 2025 +0200
docker: Add "platform" argument
This will permit building Docker images of toolchains that target other
platforms than the Dreamcast.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit ed2fd5eec43b586c4217fce7f455d5807fe7b3e3
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 6 00:20:49 2025 +0200
docker: Drop "makejobs" argument
dc-chain will already build in parallel, using a number of jobs that
corresponds to the number of CPU cores on the system.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit fd6e66dfa66a408afea03494735bd73eb490aa15
Author: Paul Cercueil <pa...@cr...>
Date: Fri May 30 19:31:32 2025 +0200
docker: Build KallistiOS from current tree
Rework the Docker script, so that it will use the current KOS tree
instead of downloading the master branch from the upstream repository.
This makes it possible to generate Docker images from different
repositories, different branches, or even with local changes.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit e8d2f25ac887164ed55c452c31464e23a8d6919e
Author: Paul Cercueil <pa...@cr...>
Date: Fri May 30 01:35:24 2025 +0200
docker: Toolchain builds need bison
Add Bison to the list of dependencies.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
.github/build-kos.sh | 8 ++++
.github/list-profiles.sh | 5 +++
.github/workflows/autobuild.yml | 93 ++++++++++++++++++++++++++++++++++++++++
utils/dc-chain/docker/Dockerfile | 20 +++++----
4 files changed, 118 insertions(+), 8 deletions(-)
create mode 100755 .github/build-kos.sh
create mode 100755 .github/list-profiles.sh
create mode 100644 .github/workflows/autobuild.yml
diff --git a/.github/build-kos.sh b/.github/build-kos.sh
new file mode 100755
index 00000000..f549fb82
--- /dev/null
+++ b/.github/build-kos.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+cd /workspace
+
+cp doc/environ.sh.sample environ.sh
+sed -i "s/KOS_BASE=.*$/KOS_BASE=\\/workspace/" environ.sh
+. environ.sh
+make
diff --git a/.github/list-profiles.sh b/.github/list-profiles.sh
new file mode 100755
index 00000000..1cc2c675
--- /dev/null
+++ b/.github/list-profiles.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd `dirname $0`/../utils/dc-chain/profiles
+
+ls -1 */*.mk |awk -F'/' '{gsub(/\.mk$/, "", $2); print "{\"platform\":\""$1"\",\"profile\":\""$2"\"}"}' | jq -R -s -c 'split("\n")[:-1]'
diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml
new file mode 100644
index 00000000..c0d31726
--- /dev/null
+++ b/.github/workflows/autobuild.yml
@@ -0,0 +1,93 @@
+name: Linux build
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+env:
+ dockerhub_user: pcercuei
+
+jobs:
+ matrix:
+ if: github.repository == 'KallistiOS/KallistiOS'
+ runs-on: ubuntu-latest
+ outputs:
+ matrix: ${{ steps.setup-matrix.outputs.matrix }}
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Setup matrix
+ id: setup-matrix
+ run: |
+ echo "matrix=$($GITHUB_WORKSPACE/.github/list-profiles.sh)" >> $GITHUB_OUTPUT
+
+ build:
+ needs: matrix
+ if: github.repository == 'KallistiOS/KallistiOS'
+ strategy:
+ fail-fast: false
+ matrix:
+ toolchain: ${{ fromJSON(needs.matrix.outputs.matrix) }}
+
+ runs-on: ubuntu-latest
+
+ env:
+ platform: ${{ fromJSON(matrix.toolchain).platform }}
+ profile: ${{ fromJSON(matrix.toolchain).profile }}
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - uses: dorny/paths-filter@v3
+ id: filter
+ with:
+ filters: |
+ paths:
+ - .github/workflows/autobuild.yml
+ - .github/workflows/build-kos.sh
+ - .github/workflows/list-profiles.sh
+ - utils/dc-chain/**
+ - '!**/*.md'
+
+ - name: build-toolchain
+ if: steps.filter.outputs.paths == 'true'
+ run: >
+ sudo docker build
+ -t $dockerhub_user/$platform-toolchain:$profile
+ --build-arg platform=$platform
+ --build-arg profile=$profile
+ -f $GITHUB_WORKSPACE/utils/dc-chain/docker/Dockerfile
+ $GITHUB_WORKSPACE
+
+ - name: publish
+ if: steps.filter.outputs.paths == 'true' && github.event_name == 'push'
+ run: |
+ echo "${{ secrets.DOCKER_HUB_KEY }}" | sudo docker login -u $dockerhub_user --password-stdin
+ sudo docker push $dockerhub_user/$platform-toolchain:$profile
+ sudo docker logout
+
+ - name: build-kos-check
+ run: |
+ if [ -d $GITHUB_WORKSPACE/kernel/arch/$platform ] ; then
+ echo "BUILD_KOS=true" >> $GITHUB_ENV
+ else
+ echo "BUILD_KOS=false" >> $GITHUB_ENV
+ fi
+
+ - name: build-kos
+ if: env.BUILD_KOS == 'true'
+ run: >
+ # Login to Docker before building to get the usage limits of an authenticated user
+ echo "${{ secrets.DOCKER_HUB_KEY }}" | sudo docker login -u $dockerhub_user --password-stdin
+
+ sudo docker run --rm --name kallistios
+ -v $GITHUB_WORKSPACE:/workspace -w /workspace
+ $dockerhub_user/$platform-toolchain:$profile
+ .github/build-kos.sh $platform
+
+ sudo docker logout
diff --git a/utils/dc-chain/docker/Dockerfile b/utils/dc-chain/docker/Dockerfile
index 8081ce11..41c77291 100644
--- a/utils/dc-chain/docker/Dockerfile
+++ b/utils/dc-chain/docker/Dockerfile
@@ -3,8 +3,8 @@
#
# usage:
# - build one of the images:
-# docker build -t dcchain:stable --build-arg dc_chain=stable .
-# docker build -t dcchain:9.3.0-legacy --build-arg dc_chain=9.3.0-legacy --build-arg makejobs=4 .
+# docker build -t dcchain:stable --build-arg profile=stable -f ./Dockerfile $KOS_BASE
+# docker build -t dcchain:9.3.0-legacy --build-arg profile=9.3.0-legacy -f ./Dockerfile $KOS_BASE
# - create and run a container, e.g. for stable:
# docker run -it --name containername dcchain:stable /bin/bash
@@ -14,7 +14,9 @@ MAINTAINER KallistiOS <cad...@li...>
# Installing prerequisites
RUN apk --update add --no-cache \
+ bison \
build-base \
+ coreutils \
gmp-dev \
mpfr-dev \
mpc1-dev \
@@ -34,12 +36,14 @@ RUN apk --update add --no-cache \
# Making Sega Dreamcast toolchains
# You may adapt the KallistiOS repository URL if needed
-ARG dc_chain=stable
-ARG makejobs=2
-RUN mkdir -p /opt/toolchains/dc \
- && git clone https://git.code.sf.net/p/cadcdev/kallistios /opt/toolchains/dc/kos || git clone https://github.com/KallistiOS/KallistiOS.git /opt/toolchains/dc/kos \
- && cd /opt/toolchains/dc/kos/utils/dc-chain \
- && make build toolchain_profile=$dc_chain makejobs=$makejobs \
+ARG platform=dreamcast
+ARG profile=stable
+
+RUN mkdir -p /opt/toolchains/dc
+COPY . /opt/toolchains/dc/kos
+
+RUN cd /opt/toolchains/dc/kos/utils/dc-chain \
+ && make build platform=$platform toolchain_profile=$profile \
&& rm -rf /opt/toolchains/dc/kos
# Stage 2
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-11 01:26: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 37b3e38e701109afc0add0158fed74b3398ff1f3 (commit)
from 62f93b8ab81c39ee6c794d03d79270f5d5c63771 (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 37b3e38e701109afc0add0158fed74b3398ff1f3
Author: kapodamy <168...@us...>
Date: Fri Oct 10 22:26:32 2025 -0300
Add missing/correct integer cast (#1226)
`tv_nsec`'s backing implementation is signed, so this helps avoid possible warnings.
-----------------------------------------------------------------------
Summary of changes:
include/kos/timer.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/kos/timer.h b/include/kos/timer.h
index fba1db59..89185e98 100644
--- a/include/kos/timer.h
+++ b/include/kos/timer.h
@@ -51,7 +51,7 @@ static inline timespec_t timer_gettime(void) {
static inline uint64_t timer_ms_gettime64(void) {
timespec_t time = timer_gettime();
- return (uint64_t)time.tv_sec * 1000 + time.tv_nsec / 1000000;
+ return (uint64_t)time.tv_sec * 1000 + (uint64_t)(time.tv_nsec / 1000000);
}
/** \brief Get the current uptime of the system (in microseconds).
@@ -64,7 +64,7 @@ static inline uint64_t timer_ms_gettime64(void) {
static inline uint64_t timer_us_gettime64(void) {
timespec_t time = timer_gettime();
- return (uint64_t)time.tv_sec * 1000000 + time.tv_nsec / 1000;
+ return (uint64_t)time.tv_sec * 1000000 + (uint64_t)(time.tv_nsec / 1000);
}
/** \brief Get the current uptime of the system (in nanoseconds).
@@ -77,7 +77,7 @@ static inline uint64_t timer_us_gettime64(void) {
static inline uint64_t timer_ns_gettime64(void) {
timespec_t time = timer_gettime();
- return (uint64_t)time.tv_sec * 1000000000 + time.tv_nsec;
+ return (uint64_t)time.tv_sec * 1000000000 + (uint64_t)time.tv_nsec;
}
/** \brief Get the current uptime of the system (in secs and millisecs).
@@ -98,7 +98,7 @@ static inline void timer_ms_gettime(uint32_t *secs, uint32_t *msecs) {
timespec_t time = timer_gettime();
if(secs) *secs = time.tv_sec;
- if(msecs) *msecs = time.tv_nsec / 1000000;
+ if(msecs) *msecs = (uint32_t)(time.tv_nsec / 1000000);
}
/** \brief Get the current uptime of the system (in secs and microsecs).
@@ -120,7 +120,7 @@ static inline void timer_us_gettime(uint32_t *secs, uint32_t *usecs) {
timespec_t time = timer_gettime();
if(secs) *secs = time.tv_sec;
- if(usecs) *usecs = time.tv_nsec / 1000;
+ if(usecs) *usecs = (uint32_t)(time.tv_nsec / 1000);
}
/** \brief Get the current uptime of the system (in secs and nanosecs).
@@ -142,7 +142,7 @@ static inline void timer_ns_gettime(uint32_t *secs, uint32_t *nsecs) {
timespec_t time = timer_gettime();
if(secs) *secs = time.tv_sec;
- if(nsecs) *nsecs = time.tv_nsec;
+ if(nsecs) *nsecs = (uint32_t)time.tv_nsec;
}
/** \brief Spin-loop delay function with microsecond granularity
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-04 19:05: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 62f93b8ab81c39ee6c794d03d79270f5d5c63771 (commit)
via f2a478156b6c2956bca53823574e4a229a621d73 (commit)
from 89817fd127fc605af3f49e28853918171fbd6229 (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 62f93b8ab81c39ee6c794d03d79270f5d5c63771
Author: Paul Cercueil <pa...@cr...>
Date: Sat Oct 4 17:18:17 2025 +0200
pvr: Add missing 'return' to pvr_set_vertical_scale()
The success path did not return anything.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit f2a478156b6c2956bca53823574e4a229a621d73
Author: Paul Cercueil <pa...@cr...>
Date: Sat Oct 4 17:11:27 2025 +0200
Mark linker symbols as uint8_t arrays
And move the definitions to the new <kos/linker.h> header.
Referencing the linker symbols as "extern uintptr_t" has a drawback: the
compiler considers that the memory area covered is just 4 bytes, and
will therefore complain if memcpy() tries to copy more than 4 bytes
from/to there. This happens in Bloom, which stores some init data into
the BSS section.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
include/kos.h | 1 +
include/kos/linker.h | 27 +++++++++++++++++++++++++++
kernel/arch/dreamcast/hardware/pvr/pvr_misc.c | 2 ++
kernel/arch/dreamcast/kernel/init.c | 6 ++----
4 files changed, 32 insertions(+), 4 deletions(-)
create mode 100644 include/kos/linker.h
diff --git a/include/kos.h b/include/kos.h
index 06fa977f..17d5f02f 100644
--- a/include/kos.h
+++ b/include/kos.h
@@ -39,6 +39,7 @@ __BEGIN_DECLS
#include <kos/fs_dev.h>
#include <kos/fs_pty.h>
#include <kos/limits.h>
+#include <kos/linker.h>
#include <kos/thread.h>
#include <kos/sem.h>
#include <kos/rwsem.h>
diff --git a/include/kos/linker.h b/include/kos/linker.h
new file mode 100644
index 00000000..7a4e6e52
--- /dev/null
+++ b/include/kos/linker.h
@@ -0,0 +1,27 @@
+/* KallistiOS ##version##
+
+ include/kos/linker.h
+ Copyright (C) 2025 Paul Cercueil
+*/
+
+/** \file kos/linker.h
+ \brief Linker script related definitions and macros.
+ \ingroup linker
+
+ \author Paul Cercueil
+*/
+
+#ifndef __KOS_LINKER_H
+#define __KOS_LINKER_H
+
+#include <kos/cdefs.h>
+__BEGIN_DECLS
+
+#include <stdint.h>
+
+extern uint8_t _bss_start[];
+extern uint8_t end[];
+
+__END_DECLS
+
+#endif /* __KOS_LINKER_H */
diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
index 8e6cd09b..eff80f2e 100644
--- a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
+++ b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
@@ -304,4 +304,6 @@ int pvr_set_vertical_scale(float factor) {
cfg |= FIELD_PREP(PVR_SCALER_CFG_VSCALE_FACTOR, f16);
PVR_SET(PVR_SCALER_CFG, cfg);
+
+ return 0;
}
diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c
index d459ad19..2287c6c2 100644
--- a/kernel/arch/dreamcast/kernel/init.c
+++ b/kernel/arch/dreamcast/kernel/init.c
@@ -14,6 +14,7 @@
#include <kos/dbgio.h>
#include <kos/dbglog.h>
#include <kos/init.h>
+#include <kos/linker.h>
#include <kos/platform.h>
#include <kos/timer.h>
#include <arch/arch.h>
@@ -30,8 +31,6 @@
#include "initall_hdrs.h"
-extern uintptr_t _bss_start, end;
-
/* ctor/dtor stuff from libgcc. */
#if __GNUC__ == 4
#define _init init
@@ -281,7 +280,6 @@ void __weak_symbol arch_auto_shutdown(void) {
/* This is the entry point inside the C program */
void arch_main(void) {
- uint8 *bss_start = (uint8 *)(&_bss_start);
int rv;
dma_init();
@@ -297,7 +295,7 @@ void arch_main(void) {
__kos_init_early_fn();
/* Clear out the BSS area */
- memset(bss_start, 0, (uintptr_t)(&end) - (uintptr_t)bss_start);
+ memset(_bss_start, 0, (uintptr_t)end - (uintptr_t)_bss_start);
/* Do auto-init stuff */
arch_auto_init();
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-03 01:03: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 89817fd127fc605af3f49e28853918171fbd6229 (commit)
via c1b2ec788d2e584f892fd67fbcf2fca00726ca74 (commit)
via c624e70a7fdf4bfdef1b513323e567c953bd115c (commit)
from c9465a67e9ca5df6a82a1c10d1145febb2915ee8 (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 89817fd127fc605af3f49e28853918171fbd6229
Author: Paul Cercueil <pa...@cr...>
Date: Thu Oct 2 12:15:41 2025 +0200
examples: pvr/fb_tex: Force vertical scale to 1.0f
The default vertical scale is actually 0.999f when a regular A/V cable
is plugged. This won't work properly here, as the error will accumulate
in the framebuffer, causing a rather neat fading effect towards the
center (but not what we want in this example).
Signed-off-by: Paul Cercueil <pa...@cr...>
commit c1b2ec788d2e584f892fd67fbcf2fca00726ca74
Author: Paul Cercueil <pa...@cr...>
Date: Thu Oct 2 12:09:46 2025 +0200
pvr: Add function pvr_set_vertical_scale()
This function can be used to configure a different vertical scale factor
used when the PVR scene is rendered to the framebuffer. It can be used
by an application when the default setting (1.0x for VGA and 0.999x for
RGB) is not good enough.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit c624e70a7fdf4bfdef1b513323e567c953bd115c
Author: Paul Cercueil <pa...@cr...>
Date: Thu Oct 2 12:08:24 2025 +0200
pvr: Clean up handling of PVR_SCALER_CFG register
Rework the code a bit so that it is more understandable.
Use regfield macros to clean it up.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
examples/dreamcast/pvr/fb_tex/fb_tex.c | 6 ++++++
.../dreamcast/hardware/pvr/pvr_init_shutdown.c | 21 +++++++++------------
kernel/arch/dreamcast/hardware/pvr/pvr_misc.c | 22 ++++++++++++++++++++++
kernel/arch/dreamcast/include/dc/pvr/pvr_misc.h | 14 ++++++++++++++
kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h | 10 ++++++++++
5 files changed, 61 insertions(+), 12 deletions(-)
diff --git a/examples/dreamcast/pvr/fb_tex/fb_tex.c b/examples/dreamcast/pvr/fb_tex/fb_tex.c
index 2eb896e5..661d27f4 100644
--- a/examples/dreamcast/pvr/fb_tex/fb_tex.c
+++ b/examples/dreamcast/pvr/fb_tex/fb_tex.c
@@ -203,6 +203,12 @@ int main(int argc, char **argv) {
/* Set the stride length for strided textures. */
pvr_txr_set_stride(640);
+ /* The default vertical scale is actually 0.999f when a regular A/V cable
+ * is plugged. This won't work properly here, as the error will accumulate
+ * in the framebuffer, causing a rather neat fading effect towards the
+ * center (but not what we want in this example). */
+ pvr_set_vertical_scale(1.0f);
+
fake_tex = pvr_mem_malloc(sizeof(fake_tex_data));
pvr_txr_load(fake_tex_data, fake_tex, sizeof(fake_tex_data));
diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c b/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c
index 7aa3b019..44df16e4 100644
--- a/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c
+++ b/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c
@@ -57,6 +57,8 @@ int pvr_init_defaults(void) {
come from the texture memory pool! Expects that a 2D mode was
initialized already using the vid_* API. */
int pvr_init(const pvr_init_params_t *params) {
+ uint16_t vscale = 1024;
+
/* If we're already initialized, fail */
if(pvr_state.valid == 1) {
dbglog(DBG_WARNING, "pvr: pvr_init called twice!\n");
@@ -130,21 +132,16 @@ int pvr_init(const pvr_init_params_t *params) {
/* If we're on a VGA box, disable vertical smoothing */
if(vid_mode->cable_type == CT_VGA) {
dbglog(DBG_KDEBUG, "pvr: disabling vertical scaling for VGA\n");
-
- if(pvr_state.fsaa)
- PVR_SET(PVR_SCALER_CFG, 0x10400);
- else
- PVR_SET(PVR_SCALER_CFG, 0x400);
- }
- else {
+ } else {
dbglog(DBG_KDEBUG, "pvr: enabling vertical scaling for non-VGA\n");
-
- if(pvr_state.fsaa)
- PVR_SET(PVR_SCALER_CFG, 0x10401);
- else
- PVR_SET(PVR_SCALER_CFG, 0x401);
+ vscale++;
}
+ /* Set horizontal / vertical scale factors */
+ PVR_SET(PVR_SCALER_CFG,
+ FIELD_PREP(PVR_SCALER_CFG_FSAA, pvr_state.fsaa) |
+ FIELD_PREP(PVR_SCALER_CFG_VSCALE_FACTOR, vscale));
+
/* Hook the PVR interrupt events on G2 */
pvr_state.vbl_handle = vblank_handler_add(pvr_vblank_handler, NULL);
diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
index e9ebf611..8e6cd09b 100644
--- a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
+++ b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c
@@ -283,3 +283,25 @@ pvr_ptr_t pvr_get_front_buffer(void) {
addressable from the 64-bit memory */
return (pvr_ptr_t)(addr * 2 + PVR_RAM_BASE);
}
+
+int pvr_set_vertical_scale(float factor) {
+ uint32_t f16;
+ uint32_t cfg;
+
+ if(factor == 0.0f)
+ return -1;
+
+ f16 = 1024.0f / factor;
+
+ if(f16 == 0 || f16 >= 65536)
+ return -1;
+
+ irq_disable_scoped();
+
+ cfg = PVR_GET(PVR_SCALER_CFG);
+
+ cfg &= ~PVR_SCALER_CFG_VSCALE_FACTOR;
+ cfg |= FIELD_PREP(PVR_SCALER_CFG_VSCALE_FACTOR, f16);
+
+ PVR_SET(PVR_SCALER_CFG, cfg);
+}
diff --git a/kernel/arch/dreamcast/include/dc/pvr/pvr_misc.h b/kernel/arch/dreamcast/include/dc/pvr/pvr_misc.h
index 22478a1f..5c7bdbaf 100644
--- a/kernel/arch/dreamcast/include/dc/pvr/pvr_misc.h
+++ b/kernel/arch/dreamcast/include/dc/pvr/pvr_misc.h
@@ -115,6 +115,20 @@ void pvr_set_shadow_scale(bool enable, float scale_value);
*/
void pvr_set_zclip(float zc);
+/** \brief Set the vertical scale factor.
+ \ingroup pvr_global
+
+ This function sets the vertical scale factor used when the PVR scene is
+ rendered to the framebuffer. Generally you want 1.0f or near-1.0f values
+ here. The default used by the PVR driver is 1.0f when using VGA, and 0.999f
+ otherwise. Having a value slightly below 1.0f gives the image a pleasant
+ smoothing.
+
+ \retval 0 On success
+ \retval -1 On invalid factor value
+*/
+int pvr_set_vertical_scale(float factor);
+
/** \brief Set the translucent polygon sort mode for the next frame.
\ingroup pvr_scene_mgmt
diff --git a/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h b/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h
index 8905596a..10076d6e 100644
--- a/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h
+++ b/kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h
@@ -218,6 +218,16 @@ __BEGIN_DECLS
#define PVR_TXR_STRIDE_MULT GENMASK(4, 0) /**< \brief Bottom 5 bits contain the size when using PVR_TXRFMT_X32_STRIDE */
/** @} */
+/** \defgroup pvr_scaler PVR_SCALER_CFG Values
+ \brief Definitions for the fields of the PVR_SCALER_CFG register.
+ \ingroup pvr_registers
+ @{
+*/
+#define PVR_SCALER_CFG_FSAA BIT(16) /**< \brief Enable FSAA */
+
+#define PVR_SCALER_CFG_VSCALE_FACTOR GENMASK(15, 0) /**< \brief Vertical scale factor = 1024 / value */
+/** @} */
+
__END_DECLS
#endif /* __DC_PVR_PVR_REGS_H */
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-10-02 19:32:05
|
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 c9465a67e9ca5df6a82a1c10d1145febb2915ee8 (commit)
from c601a70e93d67872953d2c091d496101c5692c56 (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 c9465a67e9ca5df6a82a1c10d1145febb2915ee8
Author: darc <da...@pr...>
Date: Thu Oct 2 12:27:00 2025 -0500
environ.sh.sample: Fix the comment describing the behavior of the no-PIC KOS_CFLAG
-----------------------------------------------------------------------
Summary of changes:
doc/environ.sh.sample | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/environ.sh.sample b/doc/environ.sh.sample
index efccb33d..ad6ce82b 100644
--- a/doc/environ.sh.sample
+++ b/doc/environ.sh.sample
@@ -161,7 +161,7 @@ export KOS_CFLAGS="${KOS_CFLAGS} -O2"
# Position-Independent Code
#
-# Comment this line out to enable position-dependent code. Codegen is slightly
+# Comment this line out to enable position-independent code. Codegen is slightly
# slower, and you lose a register, but it's required when building dynamically
# linked libraries or code whose symbols aren't resolved until runtime.
#
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-09-29 23:23: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 c601a70e93d67872953d2c091d496101c5692c56 (commit)
from c6df54ce9cb887569312e929a59dd12539bf1b85 (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 c601a70e93d67872953d2c091d496101c5692c56
Author: QuzarDC <qu...@co...>
Date: Mon Sep 29 19:13:11 2025 -0400
dc-chain: Update docs and mingw patch for sys/sched.h removal
Cleaning up after the removal of the patch in #1208. The
default `sys/sched.h` from newlib is used instead.
-----------------------------------------------------------------------
Summary of changes:
utils/dc-chain/doc/mingw/packages/fixup-sh4-newlib.sh | 1 -
utils/dc-chain/patches/README.md | 1 -
2 files changed, 2 deletions(-)
diff --git a/utils/dc-chain/doc/mingw/packages/fixup-sh4-newlib.sh b/utils/dc-chain/doc/mingw/packages/fixup-sh4-newlib.sh
index ddc49717..b8f218b2 100644
--- a/utils/dc-chain/doc/mingw/packages/fixup-sh4-newlib.sh
+++ b/utils/dc-chain/doc/mingw/packages/fixup-sh4-newlib.sh
@@ -17,4 +17,3 @@ cp -r $kos_base/kernel/arch/dreamcast/include/dc $newlib_inc
# they are already "cp" instructions.
cp $kos_base/include/pthread.h $newlib_inc
cp $kos_base/include/sys/_pthread.h $newlib_inc/sys
-cp $kos_base/include/sys/sched.h $newlib_inc/sys
diff --git a/utils/dc-chain/patches/README.md b/utils/dc-chain/patches/README.md
index 29f447a1..9b60d6a6 100644
--- a/utils/dc-chain/patches/README.md
+++ b/utils/dc-chain/patches/README.md
@@ -25,7 +25,6 @@ Generic `newlib` fixups (applied directly after `newlib` is installed):
```
cp $(kos_base)/include/pthread.h $(newlib_inc) # KOS pthread.h is modified
cp $(kos_base)/include/sys/_pthread.h $(newlib_inc)/sys # to define _POSIX_THREADS
-cp $(kos_base)/include/sys/sched.h $(newlib_inc)/sys # pthreads to kthreads mapping
ln -nsf $(kos_base)/include/kos $(newlib_inc) # so KOS includes are available as kos/file.h
ln -nsf $(kos_base)/kernel/arch/dreamcast/include/arch $(newlib_inc) # kos/thread.h requires arch/arch.h
ln -nsf $(kos_base)/kernel/arch/dreamcast/include/dc $(newlib_inc) # arch/arch.h requires dc/video.h
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-09-29 21:29:26
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via c6df54ce9cb887569312e929a59dd12539bf1b85 (commit)
via 026575d488a452af85bcec93223265b5818d1064 (commit)
via faec4393a9701910544d87a59675572c522a14eb (commit)
via 12a1e70747317a978d457e93a7ce2dcd621f7bd9 (commit)
via dc6f500d559658cf0deb0876653f2d2b5592240a (commit)
via f6b5f2da9abd67d28e45d0f863f91db629ad4179 (commit)
via 498d9d3bca9a1a8cdee451fae02d6117500f86f9 (commit)
via ba0cb2b6a3583f2d3340f43bbc104d6f315917d8 (commit)
from 694e333fa60be8eaf078156c7d89a5e05d369254 (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 c6df54ce9cb887569312e929a59dd12539bf1b85
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 22:46:29 2025 -0400
libppp: Remove incorrect usages of `__fallthrough`
The fallthrough attribute is only correctly used when
in a switch statement after a preceeding statement. In
these cases there were no preceeding statements, so
there will also be no implicit fallthrough warnings.
commit 026575d488a452af85bcec93223265b5818d1064
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 21:11:14 2025 -0400
libkosext2fs: Avoid shifting signed values too far.
commit faec4393a9701910544d87a59675572c522a14eb
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 21:10:30 2025 -0400
net: Set appropriate printf format specifier for size_t values.
commit 12a1e70747317a978d457e93a7ce2dcd621f7bd9
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 21:04:46 2025 -0400
fs_pty: Use unsigned int for id value.
It's not possible for the id to be set to
a negative value, and having it as a signed
int created a mismatch with `sscanf`'s prototype.
commit dc6f500d559658cf0deb0876653f2d2b5592240a
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 20:43:25 2025 -0400
fs_dclsocket: Initialize stat before passing to syscall.
commit f6b5f2da9abd67d28e45d0f863f91db629ad4179
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 20:17:20 2025 -0400
entry.s: Add newline to end of file.
Assembler was warning about it and inserting one to avoid
the file ending with a comment.
commit 498d9d3bca9a1a8cdee451fae02d6117500f86f9
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 19:31:25 2025 -0400
fs_dclsocket: Avoid possible null deref.
This could happen when building for naomi as no net
device is being specified. This code should be unreachable
in those cases, but this will quiet the warnings.
commit ba0cb2b6a3583f2d3340f43bbc104d6f315917d8
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 15:28:30 2025 -0400
timer: Explicitly cast ticks to `long int`
`timespec.tv_nsec` is implemented as a `long int` while our
`timer_val_t.ticks` is a `uint32_t`. The value will always
be limited to 999999999 as it's a count of ns, but without
explicit casting this will trigger a narrowing warning.
-----------------------------------------------------------------------
Summary of changes:
addons/libkosext2fs/bitops.c | 8 ++++----
addons/libppp/ipcp.c | 3 ---
kernel/arch/dreamcast/fs/fs_dclsocket.c | 4 +++-
kernel/arch/dreamcast/include/arch/timer.h | 2 +-
kernel/arch/dreamcast/kernel/entry.s | 2 +-
kernel/fs/fs_pty.c | 6 +++---
kernel/net/net_icmp.c | 4 ++--
kernel/net/net_icmp6.c | 4 ++--
8 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/addons/libkosext2fs/bitops.c b/addons/libkosext2fs/bitops.c
index f37ed673..71982e82 100644
--- a/addons/libkosext2fs/bitops.c
+++ b/addons/libkosext2fs/bitops.c
@@ -18,7 +18,7 @@ uint32_t ext2_bit_find_nonzero(const uint32_t *btbl, uint32_t start,
tmp = btbl[i];
if(tmp != 0) {
for(; j < 32; ++j) {
- if(tmp & (1 << j))
+ if(tmp & (1u << j))
return (i << 5) | j;
}
}
@@ -31,7 +31,7 @@ uint32_t ext2_bit_find_nonzero(const uint32_t *btbl, uint32_t start,
tmp = btbl[i];
if(tmp != 0) {
for(; j < (end & 0x1F); ++j) {
- if(tmp & (1 << j))
+ if(tmp & (1u << j))
return (i << 5) | j;
}
}
@@ -52,7 +52,7 @@ uint32_t ext2_bit_find_zero(const uint32_t *btbl, uint32_t start,
tmp = btbl[i];
if(tmp != 0xFFFFFFFF) {
for(; j < 32; ++j) {
- if(!(tmp & (1 << j)))
+ if(!(tmp & (1u << j)))
return (i << 5) | j;
}
}
@@ -65,7 +65,7 @@ uint32_t ext2_bit_find_zero(const uint32_t *btbl, uint32_t start,
tmp = btbl[i];
if(tmp != 0xFFFFFFFF) {
for(; j < (end & 0x1F); ++j) {
- if(!(tmp & (1 << j)))
+ if(!(tmp & (1u << j)))
return (i << 5) | j;
}
}
diff --git a/addons/libppp/ipcp.c b/addons/libppp/ipcp.c
index 80051b51..a1654882 100644
--- a/addons/libppp/ipcp.c
+++ b/addons/libppp/ipcp.c
@@ -177,7 +177,6 @@ static int ipcp_handle_configure_req(ppp_protocol_t *self,
case PPP_STATE_OPENED:
/* XXXX: This layer down. */
- __fallthrough;
case PPP_STATE_STOPPED:
ipcp_send_client_cfg(self, 0);
@@ -390,7 +389,6 @@ static int ipcp_handle_configure_ack(ppp_protocol_t *self,
case PPP_STATE_OPENED:
/* Uh oh... Something's gone wrong. */
/* XXXX: This layer down. */
- __fallthrough;
case PPP_STATE_ACK_RECEIVED:
/* Well, this isn't good... Resend the configure request and back
@@ -440,7 +438,6 @@ static int ipcp_handle_configure_nak(ppp_protocol_t *self,
case PPP_STATE_OPENED:
/* XXXX: This layer down. */
- __fallthrough;
case PPP_STATE_REQUEST_SENT:
case PPP_STATE_ACK_RECEIVED:
diff --git a/kernel/arch/dreamcast/fs/fs_dclsocket.c b/kernel/arch/dreamcast/fs/fs_dclsocket.c
index 72e32466..b91a6bff 100644
--- a/kernel/arch/dreamcast/fs/fs_dclsocket.c
+++ b/kernel/arch/dreamcast/fs/fs_dclsocket.c
@@ -171,6 +171,8 @@ static void dcls_recv_loop(void) {
while(!escape) {
/* If we're in an interrupt, this works differently.... */
if(irq_inside_int()) {
+ if(!net_default_dev)
+ break;
/* Since we can't count on an interrupt happening, handle it
manually, and poll the default device... */
net_default_dev->if_rx_poll(net_default_dev);
@@ -512,7 +514,7 @@ static int dcls_unlink(vfs_handler_t *vfs, const char *fn) {
static int dcls_stat(vfs_handler_t *vfs, const char *fn, struct stat *rv,
int flag) {
command_t *cmd = (command_t *)pktbuf;
- dcload_stat_t filestat;
+ dcload_stat_t filestat = { 0 };
(void)flag;
diff --git a/kernel/arch/dreamcast/include/arch/timer.h b/kernel/arch/dreamcast/include/arch/timer.h
index 99694a32..6a235152 100644
--- a/kernel/arch/dreamcast/include/arch/timer.h
+++ b/kernel/arch/dreamcast/include/arch/timer.h
@@ -262,7 +262,7 @@ static inline struct timespec arch_timer_gettime(void) {
/* Convert from ticks to nanoseconds: each clock tick is 80ns. */
return (struct timespec){
.tv_sec = time.secs,
- .tv_nsec = time.ticks * 80,
+ .tv_nsec = (long int)(time.ticks * 80),
};
}
diff --git a/kernel/arch/dreamcast/kernel/entry.s b/kernel/arch/dreamcast/kernel/entry.s
index 1ee06592..c7416cc7 100644
--- a/kernel/arch/dreamcast/kernel/entry.s
+++ b/kernel/arch/dreamcast/kernel/entry.s
@@ -342,4 +342,4 @@ _vma_table_400: ! TLB miss exceptions (MMU)
_vma_table_600: ! IRQs
nop
bra _irq_save_regs
- mov #3,r4 ! Set exception code
\ No newline at end of file
+ mov #3,r4 ! Set exception code
diff --git a/kernel/fs/fs_pty.c b/kernel/fs/fs_pty.c
index 11f5c90e..c843fcb2 100644
--- a/kernel/fs/fs_pty.c
+++ b/kernel/fs/fs_pty.c
@@ -60,7 +60,7 @@ typedef struct ptyhalf {
int refcnt; /* When this reaches zero, we close */
- int id;
+ unsigned int id;
mutex_t mutex;
condvar_t ready_read, ready_write;
@@ -329,7 +329,7 @@ static void *pty_open_file(const char *fn, int mode) {
handle fds of our own here thanks to the VFS layer, just reference
counting so a pty can be opened by more than one process. */
int master;
- int id;
+ unsigned int id;
ptyhalf_t *ph;
pipefd_t *fdobj;
@@ -678,7 +678,7 @@ static dirent_t *pty_readdir(void *h) {
static int pty_stat(vfs_handler_t *vfs, const char *path, struct stat *st,
int flag) {
ptyhalf_t *ph;
- int id;
+ unsigned int id;
int master;
size_t len = strlen(path);
diff --git a/kernel/net/net_icmp.c b/kernel/net/net_icmp.c
index 4559377b..de29f5cc 100644
--- a/kernel/net/net_icmp.c
+++ b/kernel/net/net_icmp.c
@@ -60,12 +60,12 @@ static void icmp_default_echo_cb(const uint8_t *ip, uint16_t seq, uint64_t delta
(void)data;
if(delta_us != (uint64_t) - 1) {
- printf("%d bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d time=%.3f ms\n",
+ printf("%zu bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d time=%.3f ms\n",
data_sz, ip[0], ip[1], ip[2], ip[3], seq, ttl,
delta_us / 1000.0);
}
else {
- printf("%d bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d\n", data_sz,
+ printf("%zu bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d\n", data_sz,
ip[0], ip[1], ip[2], ip[3], seq, ttl);
}
}
diff --git a/kernel/net/net_icmp6.c b/kernel/net/net_icmp6.c
index d3ce4e7d..52cb5111 100644
--- a/kernel/net/net_icmp6.c
+++ b/kernel/net/net_icmp6.c
@@ -53,11 +53,11 @@ static void icmp6_default_echo_cb(const struct in6_addr *ip, uint16_t seq,
inet_ntop(AF_INET6, ip, ipstr, INET6_ADDRSTRLEN);
if(delta_us != (uint64_t) - 1) {
- printf("%d bytes from %s, icmp_seq=%d hlim=%d time=%.3f ms\n", data_sz,
+ printf("%zu bytes from %s, icmp_seq=%d hlim=%d time=%.3f ms\n", data_sz,
ipstr, seq, hlim, delta_us / 1000.0);
}
else {
- printf("%d bytes from %s, icmp_seq=%d hlim=%d\n", data_sz, ipstr, seq,
+ printf("%zu bytes from %s, icmp_seq=%d hlim=%d\n", data_sz, ipstr, seq,
hlim);
}
}
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-09-29 21:28: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 694e333fa60be8eaf078156c7d89a5e05d369254 (commit)
from 8fb6ea27eb3fd8f6f1d08bdafffa627883b17185 (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 694e333fa60be8eaf078156c7d89a5e05d369254
Author: QuzarDC <qu...@co...>
Date: Sun Sep 28 21:29:29 2025 -0400
`maple`: Add attribute to non-NUL-terminated strings.
`maple_devinfo_t::product_*` are stored in the device
and are not guaranteed to be NUL-terminated. Since #551
these haven't been force-truncated to ensure that. The
attribute should help produce more appropriate warnings
when using the struct members.
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/include/dc/maple.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/arch/dreamcast/include/dc/maple.h b/kernel/arch/dreamcast/include/dc/maple.h
index 4c359459..eb539e05 100644
--- a/kernel/arch/dreamcast/include/dc/maple.h
+++ b/kernel/arch/dreamcast/include/dc/maple.h
@@ -229,7 +229,7 @@ typedef struct maple_frame {
This structure is used by the hardware to deliver the response to the device
info request.
- \note product_name and product_license are not guaranteed to be NULL terminated.
+ \note product_name and product_license are not guaranteed to be NUL terminated.
\headerfile dc/maple.h
*/
@@ -238,8 +238,8 @@ typedef struct maple_devinfo {
uint32 function_data[3]; /**< \brief Additional data per function */
uint8 area_code; /**< \brief Region code */
uint8 connector_direction; /**< \brief 0: UP (most controllers), 1: DOWN (lightgun, microphones) */
- char product_name[30]; /**< \brief Name of device */
- char product_license[60]; /**< \brief License statement */
+ char product_name[30] __attribute__ ((nonstring)); /**< \brief Name of device */
+ char product_license[60] __attribute__ ((nonstring)); /**< \brief License statement */
uint16 standby_power; /**< \brief Power consumption (standby) */
uint16 max_power; /**< \brief Power consumption (max) */
} maple_devinfo_t;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: quzar <qu...@us...> - 2025-09-29 03:12: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 "An image loading library.".
The branch, master has been updated
via d77ceb46f196f1866515524ed6d814eb5108268a (commit)
from 0b66623cea623ac7478b501704af432c57e0475a (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 d77ceb46f196f1866515524ed6d814eb5108268a
Author: QuzarDC <qu...@co...>
Date: Tue Sep 23 21:27:39 2025 -0400
Update to use stdint types.
This was the last piece of in-house software that was using
the `<arch/types.h>` types implicitly via the way they were
being inappropriately added to `<sys/_types.h>`.
-----------------------------------------------------------------------
Summary of changes:
imageload.c | 22 +++++++++++-----------
include/imageload.h | 26 +++++++++++++-------------
readjpeg.c | 10 +++++-----
readpcx.c | 42 +++++++++++++++++++++---------------------
4 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/imageload.c b/imageload.c
index 4e48a49..57578fe 100644
--- a/imageload.c
+++ b/imageload.c
@@ -24,13 +24,13 @@ IMG_FILE img_guess(const char *filename)
}
void
-img_copy_texture(uint16 *dest, uint8 *source, uint32 channels, uint32 stride,
- const IMG_INFO *info, uint32 w, uint32 h)
+img_copy_texture(uint16_t *dest, uint8_t *source, uint32_t channels, uint32_t stride,
+ const IMG_INFO *info, uint32_t w, uint32_t h)
{
- uint32 i,j;
- uint16 *destRow;
- uint8 *pRow;
- uint8 r,g,b;
+ uint32_t i,j;
+ uint16_t *destRow;
+ uint8_t *pRow;
+ uint8_t r,g,b;
for(i = 0; i < h; i++)
{
@@ -241,9 +241,9 @@ int img_load_file(const char *filename, IMG_INFO *info, kos_img_t *img)
int img_load_data(FILE *f, IMG_INFO *info, kos_img_t *img)
{
- uint32 channels, rowBytes;
- uint8 *data = NULL;
- uint8 allocate = 0;
+ uint32_t channels, rowBytes;
+ uint8_t *data = NULL;
+ uint8_t allocate = 0;
if (info == NULL)
{
@@ -294,8 +294,8 @@ int img_load_data(FILE *f, IMG_INFO *info, kos_img_t *img)
if (info->dither_height == 0)
info->dither_height = img->h;
- img->data = (uint16 *)malloc(sizeof(uint16)*img->w*img->h);
- img->byte_count = sizeof(uint16)*img->w*img->h;
+ img->data = (uint16_t *)malloc(sizeof(uint16_t)*img->w*img->h);
+ img->byte_count = sizeof(uint16_t)*img->w*img->h;
img_copy_texture(img->data, data, channels, rowBytes, info,
img->w, img->h);
diff --git a/include/imageload.h b/include/imageload.h
index fec2cc4..4a821ef 100644
--- a/include/imageload.h
+++ b/include/imageload.h
@@ -31,11 +31,11 @@ typedef struct
{
IMG_FILE type;
IMG_ALPHA alpha;
- uint32 key;
+ uint32_t key;
IMG_DITHER dither;
- uint32 dither_width;
- uint32 dither_height;
- uint32 noise;
+ uint32_t dither_width;
+ uint32_t dither_height;
+ uint32_t noise;
} IMG_INFO;
#define IMG_INFO_DEFAULTS {IMG_FILE_GUESS,IMG_ALPHA_NONE,0,IMG_DITHER_NONE,0,0,0}
@@ -52,27 +52,27 @@ int img_load_file(const char *filename, IMG_INFO *info, kos_img_t *img);
* create a jitter table at compile time
*/
void jitter_init(void);
-uint8 jitter(uint8 c, uint8 n, uint8 shift, uint8 noise, uint16 x, uint16 y);
+uint8 jitter(uint8_t c, uint8_t n, uint8_t shift, uint8_t noise, uint16_t x, uint16_t y);
/* Format specific loaders */
uint32 readbmp_init(FILE *infile);
-uint8 *readbmp_get_image(uint32 *pChannels, uint32 *pRowbytes,
- uint32 *pWidth, uint32 *pHeight);
+uint8 *readbmp_get_image(uint32_t *pChannels, uint32_t *pRowbytes,
+ uint32_t *pWidth, uint32_t *pHeight);
void readbmp_cleanup(void);
uint32 readpng_init(FILE *infile);
-uint8 *readpng_get_image(uint32 *pChannels, uint32 *pRowbytes,
- uint32 *pWidth, uint32 *pHeight);
+uint8 *readpng_get_image(uint32_t *pChannels, uint32_t *pRowbytes,
+ uint32_t *pWidth, uint32_t *pHeight);
void readpng_cleanup(void);
uint32 readjpeg_init(FILE *infile);
-uint8 *readjpeg_get_image(uint32 *pChannels, uint32 *pRowbytes,
- uint32 *pWidth, uint32 *pHeight);
+uint8 *readjpeg_get_image(uint32_t *pChannels, uint32_t *pRowbytes,
+ uint32_t *pWidth, uint32_t *pHeight);
void readjpeg_cleanup(void);
uint32 readpcx_init(FILE *infile);
-uint8 *readpcx_get_image(uint32 *pChannels, uint32 *pRowbytes,
- uint32 *pWidth, uint32 *pHeight);
+uint8 *readpcx_get_image(uint32_t *pChannels, uint32_t *pRowbytes,
+ uint32_t *pWidth, uint32_t *pHeight);
void readpcx_cleanup(void);
#endif
diff --git a/readjpeg.c b/readjpeg.c
index 99c4a52..39e67c7 100644
--- a/readjpeg.c
+++ b/readjpeg.c
@@ -6,7 +6,7 @@
static struct jpeg_decompress_struct cinfo;
static struct jpeg_error_mgr jerr;
-uint32 readjpeg_init(FILE *infile)
+uint32_t readjpeg_init(FILE *infile)
{
/* Step 1: allocate and initialize JPEG decompression object */
@@ -33,10 +33,10 @@ uint32 readjpeg_init(FILE *infile)
/* load n x n textures from jpegs */
-uint8 *readjpeg_get_image(uint32 *pChannels, uint32 *pRowbytes, uint32 *pWidth, uint32 *pHeight)
+uint8_t *readjpeg_get_image(uint32_t *pChannels, uint32_t *pRowbytes, uint32_t *pWidth, uint32_t *pHeight)
{
- uint32 i;
- uint8 *ourbuffer;
+ uint32_t i;
+ uint8_t *ourbuffer;
JSAMPARRAY buffer;
*pRowbytes = cinfo.output_width * cinfo.output_components;
@@ -44,7 +44,7 @@ uint8 *readjpeg_get_image(uint32 *pChannels, uint32 *pRowbytes, uint32 *pWidth,
*pWidth = cinfo.output_width;
*pHeight = cinfo.output_height;
- ourbuffer = (uint8 *)malloc(*pRowbytes**pHeight);
+ ourbuffer = (uint8_t *)malloc(*pRowbytes**pHeight);
buffer = (*cinfo.mem->alloc_sarray)((j_common_ptr) &cinfo, JPOOL_IMAGE, *pRowbytes, 1);
diff --git a/readpcx.c b/readpcx.c
index 0b8601a..fdcb3a4 100644
--- a/readpcx.c
+++ b/readpcx.c
@@ -12,38 +12,38 @@ typedef struct {
char ver; /* encoder version number (5) */
char enc; /* encoding code, always 1 */
char bpp; /* bits per pixel, 8 in mode 0x13 */
- uint16 xmin,ymin; /* image origin, usually 0,0 */
- uint16 xmax,ymax; /* image dimensions */
- uint16 hres; /* horizontal resolution value */
- uint16 vres; /* vertical resolution value */
+ uint16_t xmin,ymin; /* image origin, usually 0,0 */
+ uint16_t xmax,ymax; /* image dimensions */
+ uint16_t hres; /* horizontal resolution value */
+ uint16_t vres; /* vertical resolution value */
char pal[48]; /* palette (not in mode 0x13) */
char reserved; /* who knows? */
char clrplanes; /* number of planes, 1 in mode 0x13 */
- uint16 bpl; /* bytes per line, 80 in mode 0x13 */
- uint16 pltype; /* Grey or Color palette flag */
+ uint16_t bpl; /* bytes per line, 80 in mode 0x13 */
+ uint16_t pltype; /* Grey or Color palette flag */
char filler[58]; /* Zsoft wanted a 128 byte header */
} pcx_hdr;
FILE *pcxfile;
-uint32 readpcx_init(FILE *infile)
+uint32_t readpcx_init(FILE *infile)
{
pcxfile = infile;
return 0;
}
-uint8 *readpcx_get_image(uint32 *pChannels, uint32 *pRowBytes,
- uint32 *pWidth, uint32 *pHeight)
+uint8_t *readpcx_get_image(uint32_t *pChannels, uint32_t *pRowBytes,
+ uint32_t *pWidth, uint32_t *pHeight)
{
- pcx_hdr header;
- uint32 bytesRead;
- uint8 *preImage;
- uint8 *image;
- uint8 *palette;
- uint32 numBytes;
- uint32 i;
- uint8 pixel;
- uint8 runlen;
+ pcx_hdr header;
+ uint32_t bytesRead;
+ uint8_t *preImage;
+ uint8_t *image;
+ uint8_t *palette;
+ uint32_t numBytes;
+ uint32_t i;
+ uint8_t pixel;
+ uint8_t runlen;
bytesRead = fread(&header, sizeof(pcx_hdr), 1, pcxfile);
@@ -60,12 +60,12 @@ uint8 *readpcx_get_image(uint32 *pChannels, uint32 *pRowBytes,
for(i = 0; i < numBytes;)
{
- fread(&pixel, sizeof(uint8), 1, pcxfile);
+ fread(&pixel, sizeof(uint8_t), 1, pcxfile);
if (pixel & 0xc0)
{
runlen = (pixel & 0x3f);
- fread(&pixel, sizeof(uint8), 1, pcxfile);
+ fread(&pixel, sizeof(uint8_t), 1, pcxfile);
while(runlen--)
preImage[i++] = pixel;
}
@@ -74,7 +74,7 @@ uint8 *readpcx_get_image(uint32 *pChannels, uint32 *pRowBytes,
}
- fread(&pixel, sizeof(uint8), 1, pcxfile);
+ fread(&pixel, sizeof(uint8_t), 1, pcxfile);
palette = malloc(768);
fread(palette, 768, 1, pcxfile);
hooks/post-receive
--
An image loading library.
|
|
From: kosmirror <kos...@us...> - 2025-09-29 02:18: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 8fb6ea27eb3fd8f6f1d08bdafffa627883b17185 (commit)
from 9cfdd89884e8674cccc4372af5c60342ab67fae7 (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 8fb6ea27eb3fd8f6f1d08bdafffa627883b17185
Author: DC-SWAT <sw...@21...>
Date: Wed Sep 24 13:58:05 2025 +0700
g2dma: Fixed race condition for DMA progress checking.
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/g2dma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/arch/dreamcast/hardware/g2dma.c b/kernel/arch/dreamcast/hardware/g2dma.c
index 6d1120e2..bdd4305a 100644
--- a/kernel/arch/dreamcast/hardware/g2dma.c
+++ b/kernel/arch/dreamcast/hardware/g2dma.c
@@ -184,6 +184,7 @@ int g2_dma_transfer(void *sh4, void *g2bus, size_t length, uint32_t block,
errno = EFAULT;
return -1;
}
+ irq_disable_scoped();
/* Make sure we're not already DMA'ing */
if(dma_progress[g2chn] != 0) {
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-09-25 16:09:50
|
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 9cfdd89884e8674cccc4372af5c60342ab67fae7 (commit)
from 91e03e8fbb7b217647faf38fedf4a5ae7499674a (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 9cfdd89884e8674cccc4372af5c60342ab67fae7
Author: QuzarDC <qu...@co...>
Date: Thu Sep 25 11:52:19 2025 -0400
g2bus: Shift to stdint types
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/g2bus.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/kernel/arch/dreamcast/hardware/g2bus.c b/kernel/arch/dreamcast/hardware/g2bus.c
index 568646e2..09dbfcec 100644
--- a/kernel/arch/dreamcast/hardware/g2bus.c
+++ b/kernel/arch/dreamcast/hardware/g2bus.c
@@ -27,10 +27,10 @@
/* Read one byte from G2 */
uint8_t g2_read_8(uintptr_t address) {
g2_ctx_t ctx;
- uint8 out;
+ uint8_t out;
ctx = g2_lock();
- out = *((vuint8*)address);
+ out = *((volatile uint8_t*)address);
g2_unlock(ctx);
return out;
@@ -41,17 +41,17 @@ void g2_write_8(uintptr_t address, uint8_t value) {
g2_ctx_t ctx;
ctx = g2_lock();
- *((vuint8*)address) = value;
+ *((volatile uint8_t*)address) = value;
g2_unlock(ctx);
}
/* Read one word from G2 */
uint16_t g2_read_16(uintptr_t address) {
g2_ctx_t ctx;
- uint16 out;
+ uint16_t out;
ctx = g2_lock();
- out = *((vuint16*)address);
+ out = *((volatile uint16_t*)address);
g2_unlock(ctx);
return out;
@@ -62,17 +62,17 @@ void g2_write_16(uintptr_t address, uint16_t value) {
g2_ctx_t ctx;
ctx = g2_lock();
- *((vuint16*)address) = value;
+ *((volatile uint16_t*)address) = value;
g2_unlock(ctx);
}
/* Read one dword from G2 */
uint32_t g2_read_32(uintptr_t address) {
g2_ctx_t ctx;
- uint32 out;
+ uint32_t out;
ctx = g2_lock();
- out = *((vuint32*)address);
+ out = *((volatile uint32_t*)address);
g2_unlock(ctx);
return out;
@@ -83,13 +83,13 @@ void g2_write_32(uintptr_t address, uint32_t value) {
g2_ctx_t ctx;
ctx = g2_lock();
- *((vuint32*)address) = value;
+ *((volatile uint32_t*)address) = value;
g2_unlock(ctx);
}
/* Read a block of 8-bit values from G2 */
void g2_read_block_8(uint8_t * output, uintptr_t address, size_t amt) {
- const vuint8 * input = (const vuint8 *)address;
+ const volatile uint8_t * input = (const volatile uint8_t *)address;
g2_ctx_t ctx;
ctx = g2_lock();
@@ -102,8 +102,8 @@ void g2_read_block_8(uint8_t * output, uintptr_t address, size_t amt) {
}
/* Write a block 8-bit values to G2 */
-void g2_write_block_8(const uint8 * input, uintptr_t address, size_t amt) {
- vuint8 * output = (vuint8 *)address;
+void g2_write_block_8(const uint8_t * input, uintptr_t address, size_t amt) {
+ volatile uint8_t * output = (volatile uint8_t *)address;
g2_ctx_t ctx;
ctx = g2_lock();
@@ -117,7 +117,7 @@ void g2_write_block_8(const uint8 * input, uintptr_t address, size_t amt) {
/* Read a block of 16-bit values from G2 */
void g2_read_block_16(uint16_t * output, uintptr_t address, size_t amt) {
- const vuint16 * input = (const vuint16 *)address;
+ const volatile uint16_t * input = (const volatile uint16_t *)address;
g2_ctx_t ctx;
ctx = g2_lock();
@@ -131,7 +131,7 @@ void g2_read_block_16(uint16_t * output, uintptr_t address, size_t amt) {
/* Write a block of 16-bit values to G2 */
void g2_write_block_16(const uint16_t * input, uintptr_t address, size_t amt) {
- vuint16 * output = (vuint16 *)address;
+ volatile uint16_t * output = (volatile uint16_t *)address;
g2_ctx_t ctx;
ctx = g2_lock();
@@ -145,7 +145,7 @@ void g2_write_block_16(const uint16_t * input, uintptr_t address, size_t amt) {
/* Read a block of 32-bit values from G2 */
void g2_read_block_32(uint32_t * output, uintptr_t address, size_t amt) {
- const vuint32 * input = (const vuint32 *)address;
+ const volatile uint32_t * input = (const volatile uint32_t *)address;
g2_ctx_t ctx;
ctx = g2_lock();
@@ -159,7 +159,7 @@ void g2_read_block_32(uint32_t * output, uintptr_t address, size_t amt) {
/* Write a block of 32-bit values to G2 */
void g2_write_block_32(const uint32_t * input, uintptr_t address, size_t amt) {
- vuint32 * output = (vuint32 *)address;
+ volatile uint32_t * output = (volatile uint32_t *)address;
g2_ctx_t ctx;
ctx = g2_lock();
@@ -173,7 +173,7 @@ void g2_write_block_32(const uint32_t * input, uintptr_t address, size_t amt) {
/* A memset-like function for G2 */
void g2_memset_8(uintptr_t address, uint8_t c, size_t amt) {
- vuint8 * output = (vuint8 *)address;
+ volatile uint8_t * output = (volatile uint8_t *)address;
g2_ctx_t ctx;
ctx = g2_lock();
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-09-25 15:45: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 91e03e8fbb7b217647faf38fedf4a5ae7499674a (commit)
via 8767beb0305dedc3727e88bba9ff2fa9d92a2aa3 (commit)
via d21f3323a31a8b31002f9a5b521362b6943fff23 (commit)
via e392dbac1bbb0dd358bf25885b70b5b85fb83de8 (commit)
via 12083926c41f7d8b40bcc9fdff5c21af2ef0d96a (commit)
from 7d8cba2c46866dd4b757557826fe2967844fb520 (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 91e03e8fbb7b217647faf38fedf4a5ae7499674a
Author: QuzarDC <qu...@co...>
Date: Tue Sep 23 21:59:03 2025 -0400
newlib: Remove patching of `<sys/sched.h>`
This may have been needed when it was originally added,
but the file is effectively identical to what is provided
by newlib and there doesn't seem to be any need for it
anymore.
commit 8767beb0305dedc3727e88bba9ff2fa9d92a2aa3
Author: QuzarDC <qu...@co...>
Date: Tue Sep 23 21:41:40 2025 -0400
newlib: Stop including `<arch/types.h>` in `<sys/_types.h>`
This prevents the types from unavoidably leaking out into standard
headers, which has been a cause of a number of issues for users
especially with 3rd party libs. A number of internal files were
relying on this though, and had to be modified to either get those
types through explicit use of `<arch/types.h>` or to stop using
those types (in the cases where it was a minimal change).
In kos-ports this was still being relied on by libimageload, which
has also been updated to match.
commit d21f3323a31a8b31002f9a5b521362b6943fff23
Author: QuzarDC <qu...@co...>
Date: Tue Sep 23 20:40:45 2025 -0400
newlib: Move kos time implementation to correct path.
We were forcing this time implementation info to be included
in most of the same places it should be by tacking it onto
`<sys/_types.h>`. Instead, place it in `<machine/time.h>`
which is where newlib is set up to pick up this info by including
that in `<time.h>`.
commit e392dbac1bbb0dd358bf25885b70b5b85fb83de8
Author: QuzarDC <qu...@co...>
Date: Tue Sep 23 20:11:40 2025 -0400
newlib: Remove endian defines already provided by newlib.
These should be accesible easily from various `sys` headers'
include chains (so nobody should have needed it from _types).
I added the narrowest include to byteorder.h to have it
access them and removed from our sys/_types.
commit 12083926c41f7d8b40bcc9fdff5c21af2ef0d96a
Author: QuzarDC <qu...@co...>
Date: Tue Sep 23 02:38:17 2025 -0400
newlib: Remove patching of `AT_` fcntl defines.
These are now corectly provided by versions of newlib that
KOS supports, but require `__BSD_VISIBLE || __POSIX_VISIBLE >= 200809`
so the language standard for `libkosext2fs` had to be updated to
have gnu extensions in order to levereage them.
-----------------------------------------------------------------------
Summary of changes:
addons/libkosext2fs/Makefile | 2 +-
include/{kos => machine}/time.h | 6 ++--
include/sys/_types.h | 42 ----------------------
include/sys/sched.h | 29 ---------------
kernel/arch/dreamcast/hardware/ubc.c | 14 ++++----
kernel/arch/dreamcast/hardware/vblank.c | 3 +-
kernel/arch/dreamcast/include/arch/byteorder.h | 3 ++
kernel/arch/dreamcast/include/dc/fb_console.h | 1 +
kernel/arch/dreamcast/include/dc/modem/modem.h | 2 ++
.../dreamcast/include/dc/net/broadband_adapter.h | 2 ++
utils/dc-chain/scripts/newlib.mk | 1 -
11 files changed, 21 insertions(+), 84 deletions(-)
rename include/{kos => machine}/time.h (97%)
delete mode 100644 include/sys/sched.h
diff --git a/addons/libkosext2fs/Makefile b/addons/libkosext2fs/Makefile
index 0a4f9a79..108d7d21 100644
--- a/addons/libkosext2fs/Makefile
+++ b/addons/libkosext2fs/Makefile
@@ -6,6 +6,6 @@ OBJS = ext2fs.o bitops.o block.o inode.o superblock.o fs_ext2.o symlink.o \
directory.o
# Make sure everything compiles nice and cleanly (or not at all).
-KOS_CFLAGS += -W -pedantic -Werror -std=c99
+KOS_CFLAGS += -W -pedantic -Werror -std=gnu99
include $(KOS_BASE)/addons/Makefile.prefab
diff --git a/include/kos/time.h b/include/machine/time.h
similarity index 97%
rename from include/kos/time.h
rename to include/machine/time.h
index 5fa1f7ba..c47a5c9f 100644
--- a/include/kos/time.h
+++ b/include/machine/time.h
@@ -1,11 +1,11 @@
/* KallistiOS ##version##
- kos/time.h
+ machine/time.h
Copyright (C) 2023 Lawrence Sebald
Copyright (C) 2024 Falco Girgis
*/
-/** \file kos/time.h
+/** \file machine/time.h
\brief KOS-implementation of select C11 and POSIX extensions
Add select POSIX extensions, C11, and C23 functionality to time.h which are not
@@ -40,7 +40,7 @@ __BEGIN_DECLS
#define __STDC_VERSION_TIME_H__ 202311L
/* Microsecond resolution for clock(), per POSIX standard.. */
-#define CLOCKS_PER_SEC 1000000
+#define _CLOCKS_PER_SEC_ 1000000
/* =============== Enable the following for >=c11, >=c++17 =================== */
#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \
diff --git a/include/sys/_types.h b/include/sys/_types.h
index 3110877d..cb8d653b 100644
--- a/include/sys/_types.h
+++ b/include/sys/_types.h
@@ -155,48 +155,11 @@ typedef _TIMER_T_ __timer_t;
typedef _CLOCK_T_ __clock_t;
-/* The architecture should define the macro BYTE_ORDER in <arch/types.h> to
- equal one of these macros for code that looks for these BSD-style macros. */
-/** \brief Little Endian test macro */
-#define LITTLE_ENDIAN 1234
-
-/** \brief Big Endian test macro */
-#define BIG_ENDIAN 4321
-
-/** \brief PDP Endian test macro */
-#define PDP_ENDIAN 3412
-
-/* Sigh... for some reason, Newlib only bothers defining these on Cygwin...
- We're only actually concerned with AT_SYMLINK_NOFOLLOW currently. These
- should all be defined in <fcntl.h>, by the way. */
-#ifndef AT_EACCESS
-/** \brief Check access using effective user and group ID */
-#define AT_EACCESS 1
-#endif
-
-#ifndef AT_SYMLINK_NOFOLLOW
-/** \brief Do not follow symlinks */
-#define AT_SYMLINK_NOFOLLOW 2
-#endif
-
-#ifndef AT_SYMLINK_FOLLOW
-/** \brief Follow symbolic links */
-#define AT_SYMLINK_FOLLOW 4
-#endif
-
-#ifndef AT_REMOVEDIR
-/** \brief Remove directory instead of file */
-#define AT_REMOVEDIR 8
-#endif
-
#ifndef IOV_MAX
/** \brief Maximum length of an iovec, in elements. */
#define IOV_MAX 1024
#endif
-/* This is for old KOS source compatibility. */
-#include <arch/types.h>
-
#if __GNUC_MINOR__ > 95 || __GNUC__ >= 3
typedef __builtin_va_list __va_list;
#else
@@ -209,11 +172,6 @@ __END_DECLS
#endif /* _SYS__TYPES_H */
-/* Grab our C11 time stuff if we got here from <time.h>. */
-#ifdef _TIME_H_
-#include <kos/time.h>
-#endif
-
#ifdef _STDLIB_H_
#include <kos/stdlib.h>
#endif
diff --git a/include/sys/sched.h b/include/sys/sched.h
deleted file mode 100644
index 2e040f62..00000000
--- a/include/sys/sched.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/** \file sys/sched.h
- \brief Basic sys/sched.h file for newlib.
-
- This file specifies a few things to make sure pthreads stuff compiles.
-*/
-
-#ifndef __SYS_SCHED_H
-#define __SYS_SCHED_H
-
-#include <sys/cdefs.h>
-__BEGIN_DECLS
-
-// These are copied from Newlib to make stuff compile as expected.
-
-#define SCHED_OTHER 0 /**< \brief Other scheduling */
-#define SCHED_FIFO 1 /**< \brief FIFO scheduling */
-#define SCHED_RR 2 /**< \brief Round-robin scheduling */
-
-/** \brief Scheduling Parameters, P1003.1b-1993, p. 249.
- \note Fields whose name begins with "ss_" added by P1003.4b/D8, p. 33.
- \headerfile sys/sched.h
-*/
-struct sched_param {
- int sched_priority; /**< \brief Process execution scheduling priority */
-};
-
-__END_DECLS
-
-#endif /* __SYS_SCHED_H */
diff --git a/kernel/arch/dreamcast/hardware/ubc.c b/kernel/arch/dreamcast/hardware/ubc.c
index 4e96c666..75d685f6 100755
--- a/kernel/arch/dreamcast/hardware/ubc.c
+++ b/kernel/arch/dreamcast/hardware/ubc.c
@@ -15,10 +15,10 @@
#include <assert.h>
/* Macros for accessing SFRs common to both channels by index */
-#define BAR(o) (*((vuint32 *)(uintptr_t)(SH4_REG_UBC_BARA + (unsigned)(o) * 0xc))) /* Address */
-#define BASR(o) (*((vuint8 *)(uintptr_t)(SH4_REG_UBC_BASRA + (unsigned)(o) * 0x4))) /* ASID */
-#define BAMR(o) (*((vuint8 *)(uintptr_t)(SH4_REG_UBC_BAMRA + (unsigned)(o) * 0xc))) /* Address Mask */
-#define BBR(o) (*((vuint16 *)(uintptr_t)(SH4_REG_UBC_BBRA + (unsigned)(o) * 0xc))) /* Bus Cycle */
+#define BAR(o) (*((volatile uint32_t *)(uintptr_t)(SH4_REG_UBC_BARA + (unsigned)(o) * 0xc))) /* Address */
+#define BASR(o) (*((volatile uint8_t *)(uintptr_t)(SH4_REG_UBC_BASRA + (unsigned)(o) * 0x4))) /* ASID */
+#define BAMR(o) (*((volatile uint8_t *)(uintptr_t)(SH4_REG_UBC_BAMRA + (unsigned)(o) * 0xc))) /* Address Mask */
+#define BBR(o) (*((volatile uint16_t *)(uintptr_t)(SH4_REG_UBC_BBRA + (unsigned)(o) * 0xc))) /* Bus Cycle */
/* Macros for accessing individual, channel-specific SFRs */
#define BARA (BAR(ubc_channel_a)) /**< Break Address A */
@@ -29,9 +29,9 @@
#define BASRB (BASR(ubc_channel_b)) /**< Break ASID B */
#define BAMRB (BAMR(ubc_channel_b)) /**< Break Address Mask B */
#define BBRB (BBR(ubc_channel_b)) /**< Break Bus Cycle B */
-#define BDRB (*((vuint32 *)SH4_REG_UBC_BDRB)) /**< Break Data B */
-#define BDMRB (*((vuint32 *)SH4_REG_UBC_BDMRB)) /**< Break Data Mask B */
-#define BRCR (*((vuint16 *)SH4_REG_UBC_BRCR)) /**< Break Control */
+#define BDRB (*((volatile uint32_t *)SH4_REG_UBC_BDRB)) /**< Break Data B */
+#define BDMRB (*((volatile uint32_t *)SH4_REG_UBC_BDMRB)) /**< Break Data Mask B */
+#define BRCR (*((volatile uint16_t *)SH4_REG_UBC_BRCR)) /**< Break Control */
/* BASR Fields */
#define BASM (1 << 2) /* No ASID (1), use ASID (0) */
diff --git a/kernel/arch/dreamcast/hardware/vblank.c b/kernel/arch/dreamcast/hardware/vblank.c
index abf93c88..175c84fa 100644
--- a/kernel/arch/dreamcast/hardware/vblank.c
+++ b/kernel/arch/dreamcast/hardware/vblank.c
@@ -4,6 +4,7 @@
Copyright (C)2003 Megan Potter
*/
+#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/queue.h>
@@ -28,7 +29,7 @@ static TAILQ_HEAD(vhlist, vblhnd) vblhnds;
static int vblid_high;
/* Our internal IRQ handler */
-static void vblank_handler(uint32 src, void *data) {
+static void vblank_handler(uint32_t src, void *data) {
struct vblhnd * t;
(void)data;
diff --git a/kernel/arch/dreamcast/include/arch/byteorder.h b/kernel/arch/dreamcast/include/arch/byteorder.h
index 2d352621..0bb1f2fc 100644
--- a/kernel/arch/dreamcast/include/arch/byteorder.h
+++ b/kernel/arch/dreamcast/include/arch/byteorder.h
@@ -25,6 +25,9 @@
#include <kos/cdefs.h>
__BEGIN_DECLS
+/* Included to get the `LITTLE_ENDIAN` define */
+#include <machine/endian.h>
+
#ifdef BYTE_ORDER
/* If we've included <arch/types.h>, this might already be defined... */
#undef BYTE_ORDER
diff --git a/kernel/arch/dreamcast/include/dc/fb_console.h b/kernel/arch/dreamcast/include/dc/fb_console.h
index 31dde8ee..8a718707 100644
--- a/kernel/arch/dreamcast/include/dc/fb_console.h
+++ b/kernel/arch/dreamcast/include/dc/fb_console.h
@@ -27,6 +27,7 @@
#include <kos/cdefs.h>
__BEGIN_DECLS
+#include <arch/types.h>
#include <kos/dbgio.h>
/* \cond */
diff --git a/kernel/arch/dreamcast/include/dc/modem/modem.h b/kernel/arch/dreamcast/include/dc/modem/modem.h
index 1362c92d..81df223f 100644
--- a/kernel/arch/dreamcast/include/dc/modem/modem.h
+++ b/kernel/arch/dreamcast/include/dc/modem/modem.h
@@ -20,6 +20,8 @@
#ifndef __DC_MODEM_MODEM_H
#define __DC_MODEM_MODEM_H
+#include <arch/types.h>
+
#include "mconst.h"
/** \defgroup modem Modem
diff --git a/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h b/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h
index 7d6548b0..969ce44f 100644
--- a/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h
+++ b/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h
@@ -22,6 +22,8 @@
#include <kos/cdefs.h>
__BEGIN_DECLS
+#include <arch/types.h>
+
/** \defgroup bba Broadband Adapter
\brief Driver for the Dreamcast's BBA (RTL8139C).
\ingroup networking_drivers
diff --git a/utils/dc-chain/scripts/newlib.mk b/utils/dc-chain/scripts/newlib.mk
index 48e833f3..0e665b03 100644
--- a/utils/dc-chain/scripts/newlib.mk
+++ b/utils/dc-chain/scripts/newlib.mk
@@ -44,7 +44,6 @@ fixup-newlib-apply: fixup-newlib-init
cp $(kos_base)/include/pthread.h $(newlib_inc)
cp $(kos_base)/include/sys/_pthreadtypes.h $(newlib_inc)/sys
cp $(kos_base)/include/sys/_pthread.h $(newlib_inc)/sys
- cp $(kos_base)/include/sys/sched.h $(newlib_inc)/sys
ifndef MINGW32
ln -nsf $(kos_base)/include/kos $(newlib_inc)
ln -nsf $(kos_base)/kernel/arch/$(platform)/include/arch $(newlib_inc)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-09-25 15:44:23
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 7d8cba2c46866dd4b757557826fe2967844fb520 (commit)
via db7081ba931f97d241fa9e8e684f566544da531d (commit)
via 0a673d1bff9d2c454d71df1064d73b808d5c4876 (commit)
via 4e9d15d687d3bd527f9cec3abf337bcc1bccaee3 (commit)
from d8f7df2599dc3e147ae585855f396d74e8a28ef4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7d8cba2c46866dd4b757557826fe2967844fb520
Author: QuzarDC <qu...@co...>
Date: Thu Sep 11 11:47:09 2025 -0400
init: Privatize prototype for `arch_real_exit`
This is clearly meant to be internal, and was described
as such. Just actually doing so.
commit db7081ba931f97d241fa9e8e684f566544da531d
Author: QuzarDC <qu...@co...>
Date: Thu Sep 11 10:44:58 2025 -0400
Remove extraneous includes of <arch/spinlock.h>
I was looking for *any* unneeded includes and for some reason
these were all over the place. I don't see any reason that
they'd be needed and things build fine without.
commit 0a673d1bff9d2c454d71df1064d73b808d5c4876
Author: QuzarDC <qu...@co...>
Date: Thu Sep 11 00:36:58 2025 -0400
thread: Move definition of `tid_t` to thread.h
Almost every place internally that was using it was
doing so by including <kos/thread.h> rather than
<arch/types.h> (though partially due to previous
cleanups).
commit 4e9d15d687d3bd527f9cec3abf337bcc1bccaee3
Author: QuzarDC <qu...@co...>
Date: Wed Sep 10 22:20:55 2025 -0400
library: Remove unnecessary use of `tid_t`.
The two types have nothing to do with each other. Instead
unrolled it to the type it has always been, an int.
-----------------------------------------------------------------------
Summary of changes:
include/kos/library.h | 4 +---
include/kos/thread.h | 4 ++++
kernel/arch/dreamcast/hardware/asic.c | 1 -
kernel/arch/dreamcast/hardware/g2bus.c | 1 -
kernel/arch/dreamcast/hardware/scif.c | 1 -
kernel/arch/dreamcast/include/arch/arch.h | 10 ----------
kernel/arch/dreamcast/include/arch/types.h | 9 ---------
kernel/arch/dreamcast/kernel/init.c | 3 +++
kernel/libc/koslib/malloc.c | 6 ++++--
9 files changed, 12 insertions(+), 27 deletions(-)
diff --git a/include/kos/library.h b/include/kos/library.h
index da0d718c..feb4b114 100644
--- a/include/kos/library.h
+++ b/include/kos/library.h
@@ -31,7 +31,6 @@
#include <kos/cdefs.h>
__BEGIN_DECLS
-#include <kos/thread.h>
#include <kos/elf.h>
#include <kos/fs.h>
@@ -49,8 +48,7 @@ TAILQ_HEAD(klqueue, klibrary);
LIST_HEAD(kllist, klibrary);
/** \endcond */
-/* Thread IDs are ok for us */
-typedef tid_t libid_t; /**< \brief Library ID type. */
+typedef int libid_t; /**< \brief Library ID type. */
/** \brief Loaded library structure.
diff --git a/include/kos/thread.h b/include/kos/thread.h
index 22a798ae..e0b8f9c6 100644
--- a/include/kos/thread.h
+++ b/include/kos/thread.h
@@ -151,6 +151,10 @@ typedef enum kthread_state {
STATE_FINISHED = 0x0004 /**< \brief Finished execution */
} kthread_state_t;
+/* Thread and priority types */
+typedef int tid_t; /**< \brief Thread ID type */
+typedef int prio_t; /**< \brief Priority value type */
+
/** \brief Structure describing one running thread.
Each thread has one of these structures assigned to it, which holds all the
diff --git a/kernel/arch/dreamcast/hardware/asic.c b/kernel/arch/dreamcast/hardware/asic.c
index 725ff3ae..9cc0329b 100644
--- a/kernel/arch/dreamcast/hardware/asic.c
+++ b/kernel/arch/dreamcast/hardware/asic.c
@@ -100,7 +100,6 @@
#include <assert.h>
#include <arch/irq.h>
#include <dc/asic.h>
-#include <arch/spinlock.h>
#include <kos/genwait.h>
#include <kos/regfield.h>
#include <kos/worker_thread.h>
diff --git a/kernel/arch/dreamcast/hardware/g2bus.c b/kernel/arch/dreamcast/hardware/g2bus.c
index 0b1bdf44..568646e2 100644
--- a/kernel/arch/dreamcast/hardware/g2bus.c
+++ b/kernel/arch/dreamcast/hardware/g2bus.c
@@ -20,7 +20,6 @@
#include <string.h>
#include <stdio.h>
#include <dc/g2bus.h>
-#include <arch/spinlock.h>
/* Always use these functions to access G2 bus memory (includes the SPU
and the expansion port, e.g., BBA) */
diff --git a/kernel/arch/dreamcast/hardware/scif.c b/kernel/arch/dreamcast/hardware/scif.c
index 41eb0b55..c61d2d77 100644
--- a/kernel/arch/dreamcast/hardware/scif.c
+++ b/kernel/arch/dreamcast/hardware/scif.c
@@ -8,7 +8,6 @@
#include <errno.h>
#include <kos/dbgio.h>
#include <arch/arch.h>
-#include <arch/spinlock.h>
#include <arch/irq.h>
#include <dc/fs_dcload.h>
#include <dc/scif.h>
diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h
index 2fd7981e..a152d691 100644
--- a/kernel/arch/dreamcast/include/arch/arch.h
+++ b/kernel/arch/dreamcast/include/arch/arch.h
@@ -213,16 +213,6 @@ void * mm_sbrk(unsigned long increment);
#include <kos/init.h>
/* Dreamcast-specific arch init things */
-/** \brief Jump back to the bootloader.
- \ingroup arch
-
- You generally shouldn't use this function, but rather use arch_exit() or
- exit() instead.
-
- \note This function will never return!
-*/
-void arch_real_exit(int ret_code) __noreturn;
-
/** \brief Initialize bare-bones hardware systems.
\ingroup arch
diff --git a/kernel/arch/dreamcast/include/arch/types.h b/kernel/arch/dreamcast/include/arch/types.h
index 295bc031..ae1b2439 100644
--- a/kernel/arch/dreamcast/include/arch/types.h
+++ b/kernel/arch/dreamcast/include/arch/types.h
@@ -48,15 +48,6 @@ typedef volatile int32 vint32; /**< \brief 32-bit volatile signed type */
typedef volatile int16 vint16; /**< \brief 16-bit volatile signed type */
typedef volatile int8 vint8; /**< \brief 8-bit volatile signed type */
-/* This type may be used for any generic handle type that is allowed
- to be negative (for errors) and has no specific bit count
- restraints. */
-typedef int handle_t; /**< \brief Generic "handle" type */
-
-/* Thread and priority types */
-typedef handle_t tid_t; /**< \brief Thread ID type */
-typedef handle_t prio_t; /**< \brief Priority value type */
-
/** @} */
__END_DECLS
diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c
index 73221e63..d459ad19 100644
--- a/kernel/arch/dreamcast/kernel/init.c
+++ b/kernel/arch/dreamcast/kernel/init.c
@@ -43,6 +43,9 @@ extern void _fini(void);
extern void __verify_newlib_patch();
extern void dma_init(void);
+/* Jump back to the bootloader. From startup.S */
+void arch_real_exit(int ret_code) __noreturn;
+
void (*__kos_init_early_fn)(void) __attribute__((weak,section(".data"))) = NULL;
int main(int argc, char **argv);
diff --git a/kernel/libc/koslib/malloc.c b/kernel/libc/koslib/malloc.c
index aedfeaec..ef2c918e 100644
--- a/kernel/libc/koslib/malloc.c
+++ b/kernel/libc/koslib/malloc.c
@@ -1650,6 +1650,10 @@ static pthread_mutex_t mALLOC_MUTEx = PTHREAD_MUTEX_INITIALIZER;
#ifdef KM_DBG
+#include <stdlib.h>
+#include <kos/dbgio.h>
+#include <kos/thread.h>
+
#define BLOCK_MAGIC 0x1c518a74
#define PRE_MAGIC 0x6765adb8
#define POST_MAGIC 0x29d4ca6d
@@ -1679,8 +1683,6 @@ static LIST_HEAD(memctl_list, memctl) block_list;
#define get_cur_tid_safe ((thd_current == NULL) ? (tid_t)0 : thd_current->tid)
-#include <kos/dbgio.h>
-#include <stdlib.h>
char dbg_print_buffer[256];
enum func_type_names { name_MALLOC = 0, name_REALLOC = 1, name_MEMALIGN = 2, name_CALLOC = 3,
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|