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-08-27 05:42:57
|
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 b2f9efc31f65b43f52d9db9d474685f386beef2e (commit)
via 0441dbb88d2e4ab7ce2de62fc276a214375ea1ac (commit)
from 7bd48056e76e750d1c90e0cc4aeb156f46da31f8 (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 b2f9efc31f65b43f52d9db9d474685f386beef2e
Author: darc <da...@pr...>
Date: Tue Aug 26 14:28:07 2025 -0500
Update examples to use new dc/wdt.h header
commit 0441dbb88d2e4ab7ce2de62fc276a214375ea1ac
Author: darc <da...@pr...>
Date: Tue Aug 26 14:23:53 2025 -0500
Move Dreamcast wdt driver from arch/ to dc/
-----------------------------------------------------------------------
Summary of changes:
.../dreamcast/basic/threading/barrier/barrier.c | 4 +-
examples/dreamcast/cpp/concurrency/concurrency.cpp | 2 +-
kernel/arch/dreamcast/hardware/Makefile | 2 +-
kernel/arch/dreamcast/{kernel => hardware}/wdt.c | 2 +-
kernel/arch/dreamcast/include/arch/kos.h | 2 +-
kernel/arch/dreamcast/include/arch/rtc.h | 2 +-
kernel/arch/dreamcast/include/arch/timer.h | 2 +-
kernel/arch/dreamcast/include/arch/wdt.h | 194 +--------------------
kernel/arch/dreamcast/include/{arch => dc}/wdt.h | 10 +-
kernel/arch/dreamcast/kernel/Makefile | 2 +-
kernel/arch/dreamcast/kernel/init.c | 2 +-
11 files changed, 18 insertions(+), 206 deletions(-)
rename kernel/arch/dreamcast/{kernel => hardware}/wdt.c (99%)
copy kernel/arch/dreamcast/include/{arch => dc}/wdt.h (97%)
diff --git a/examples/dreamcast/basic/threading/barrier/barrier.c b/examples/dreamcast/basic/threading/barrier/barrier.c
index 51b1de2a..2eb4d979 100644
--- a/examples/dreamcast/basic/threading/barrier/barrier.c
+++ b/examples/dreamcast/basic/threading/barrier/barrier.c
@@ -17,7 +17,7 @@
#include <kos/thread.h>
#include <kos/barrier.h>
-#include <arch/wdt.h>
+#include <dc/wdt.h>
#include <stdlib.h>
#include <stdint.h>
@@ -193,4 +193,4 @@ int main(int argc, char* argv[]) {
fprintf(stderr, "\nXXXXX TEST COMPLETE: FAILURE XXXXX\n\n");
return EXIT_FAILURE;
}
-}
\ No newline at end of file
+}
diff --git a/examples/dreamcast/cpp/concurrency/concurrency.cpp b/examples/dreamcast/cpp/concurrency/concurrency.cpp
index 594663cf..e77abf08 100644
--- a/examples/dreamcast/cpp/concurrency/concurrency.cpp
+++ b/examples/dreamcast/cpp/concurrency/concurrency.cpp
@@ -61,7 +61,7 @@
#include <exception>
#include <string>
-#include <arch/wdt.h>
+#include <dc/wdt.h>
// 20 seconds in us
inline constexpr unsigned WATCHDOG_TIMEOUT = (20 * 1000 * 1000);
diff --git a/kernel/arch/dreamcast/hardware/Makefile b/kernel/arch/dreamcast/hardware/Makefile
index 3b78ca9e..6038e310 100644
--- a/kernel/arch/dreamcast/hardware/Makefile
+++ b/kernel/arch/dreamcast/hardware/Makefile
@@ -28,7 +28,7 @@ OBJS += asic.o g2bus.o
OBJS += video.o vblank.o
# CPU-related
-OBJS += sq.o sq_fast_cpy.o scif.o sci.o ubc.o dmac.o
+OBJS += sq.o sq_fast_cpy.o scif.o sci.o ubc.o dmac.o wdt.o
# SPI device support
OBJS += scif-spi.o sd.o
diff --git a/kernel/arch/dreamcast/kernel/wdt.c b/kernel/arch/dreamcast/hardware/wdt.c
similarity index 99%
rename from kernel/arch/dreamcast/kernel/wdt.c
rename to kernel/arch/dreamcast/hardware/wdt.c
index 227e5768..59e0d9f6 100644
--- a/kernel/arch/dreamcast/kernel/wdt.c
+++ b/kernel/arch/dreamcast/hardware/wdt.c
@@ -6,9 +6,9 @@
/* This file contains the implementation of the SH4 watchdog timer driver. */
-#include <arch/wdt.h>
#include <arch/irq.h>
#include <kos/regfield.h>
+#include <dc/wdt.h>
/* Macros for accessing WDT registers */
#define WDT(o, t) (*((volatile t *)(WDT_BASE + (o))))
diff --git a/kernel/arch/dreamcast/include/arch/kos.h b/kernel/arch/dreamcast/include/arch/kos.h
index 27056363..964cb752 100644
--- a/kernel/arch/dreamcast/include/arch/kos.h
+++ b/kernel/arch/dreamcast/include/arch/kos.h
@@ -25,7 +25,6 @@ __BEGIN_DECLS
#include <arch/gdb.h>
#include <arch/mmu.h>
#include <arch/memory.h>
-#include <arch/wdt.h>
#include <dc/asic.h>
#include <dc/biosfont.h>
@@ -68,6 +67,7 @@ __BEGIN_DECLS
#include <dc/vmu_fb.h>
#include <dc/vmu_pkg.h>
#include <dc/vmufs.h>
+#include <dc/wdt.h>
__END_DECLS
diff --git a/kernel/arch/dreamcast/include/arch/rtc.h b/kernel/arch/dreamcast/include/arch/rtc.h
index 43181072..d60deb67 100644
--- a/kernel/arch/dreamcast/include/arch/rtc.h
+++ b/kernel/arch/dreamcast/include/arch/rtc.h
@@ -15,7 +15,7 @@
standard C functions, like time(), rather than these when simply needing
to fetch the current system time.
- \sa arch/wdt.h
+ \sa dc/wdt.h
\author Megan Potter
\author Falco Girgis
diff --git a/kernel/arch/dreamcast/include/arch/timer.h b/kernel/arch/dreamcast/include/arch/timer.h
index f12572c1..caf1290c 100644
--- a/kernel/arch/dreamcast/include/arch/timer.h
+++ b/kernel/arch/dreamcast/include/arch/timer.h
@@ -18,7 +18,7 @@
the gettime functions.
\sa arch/rtc.h
- \sa arch/wdt.h
+ \sa dc/wdt.h
\author Megan Potter
\author Falco Girgis
diff --git a/kernel/arch/dreamcast/include/arch/wdt.h b/kernel/arch/dreamcast/include/arch/wdt.h
index ece78b4b..b4dc7587 100644
--- a/kernel/arch/dreamcast/include/arch/wdt.h
+++ b/kernel/arch/dreamcast/include/arch/wdt.h
@@ -1,197 +1,9 @@
/* KallistiOS ##version##
- arch/dreamcast/include/wdt.h
- Copyright (C) 2023 Falco Girgis
+ kernel/arch/dreamcast/include/arch/wdt.h
*/
-/** \file arch/wdt.h
- \brief Watchdog Timer API
- \ingroup wdt
+#include <dc/wdt.h>
- This file provides an API for configuring and utilizing the SH4's watchdog
- timer as either a reset or an interval timer.
-
- \sa arch/timer.h
- \sa arch/rtc.h
-
- \author Falco Girgis
-*/
-
-#ifndef __ARCH_WDT_H
-#define __ARCH_WDT_H
-
-#include <kos/cdefs.h>
-__BEGIN_DECLS
-
-#include <stdint.h>
-
-/** \defgroup wdt Watchdog Timer
- \brief Driver for using the WDT as a reset or interval timer
- \ingroup timing
-
- The watchdog timer (WDT) is a special-purpose timer peripheral integrated
- within the Dreamcast's SH4 CPU.
-
- \warning
- At this time, there are no known emulators which are emulating the WDT,
- as it was never used in commercial games; however, it works perfectly fine
- on real hardware.
-
- There are two different modes of operation which are supported:
- - watchdog mode: counter overflow causes a reset interrupt
- - interval timer mode: counter overflow invokes a callback function
-
- To start the WDT in watchdog mode, use wdt_enable_watchdog(). To use the
- WDT as a general-purpose interval timer, use wdt_enable_timer().
-
- The timer can be stopped in either mode by calling wdt_disable().
-
- \sa rtc
-*/
-
-/** \brief Clock divider settings
- \ingroup wdt
-
- Denominators used to set the frequency divider
- for the input clock to the WDT.
- */
-typedef enum WDT_CLK_DIV {
- WDT_CLK_DIV_32, /**< \brief Period: 41us */
- WDT_CLK_DIV_64, /**< \brief Period: 82us */
- WDT_CLK_DIV_128, /**< \brief Period: 164us */
- WDT_CLK_DIV_256, /**< \brief Period: 328us */
- WDT_CLK_DIV_512, /**< \brief Period: 656us */
- WDT_CLK_DIV_1024, /**< \brief Period: 1.31ms */
- WDT_CLK_DIV_2048, /**< \brief Period: 2.62ms */
- WDT_CLK_DIV_4096 /**< \brief Period: 5.25ms */
-} WDT_CLK_DIV;
-
-/** \brief Reset signal type
- \ingroup wdt
-
- Specifies the kind of reset to be performed when the WDT
- overflows in watchdog mode.
-*/
-typedef enum WDT_RST {
- WDT_RST_POWER_ON, /**< \brief Power-On Reset */
- WDT_RST_MANUAL /**< \brief Manual Reset */
-} WDT_RST;
-
-/* \brief WDT interval timer callback function type
- \ingroup wdt
-
- Type of the callback function to be passed to wdt_enable_timer().
-*/
-typedef void (*wdt_callback)(void *user_data);
-
-/** \brief Enables the WDT as an interval timer
- \ingroup wdt
-
- Stops the WDT if it was previously running and reconfigures it
- to be used as a generic interval timer, calling the given callback
- periodically at the requested interval (or as close to it as possible
- without calling it prematurely).
-
- \note
- The internal resolution for each tick of the WDT in this mode is
- 41us, meaning a requested \p microsec_period of 100us will result
- in an actual callback interval of 123us.
-
- \warning
- \p callback is invoked within an interrupt context, meaning that
- special care should be taken to not perform any logic requiring
- additional interrupts. Data that is accessed from both within
- and outside of the callback should be atomic or protected by a
- lock.
-
- \param initial_count Initial value of the WDT counter (Normally 0).
- \param microsec_period Timer callback interval in microseconds
- \param irq_prio Priority for the interval timer IRQ (1-15)
- \param callback User function to invoke periodically
- \param user_data Arbitrary user-provided data for the callback
-
- \sa wdt_disable()
-*/
-void wdt_enable_timer(uint8_t initial_count,
- uint32_t microsec_period,
- uint8_t irq_prio,
- wdt_callback callback,
- void *user_data);
-
-/** \brief Enables the WDT in watchdog mode
- \ingroup wdt
-
- Stops the WDT if it was previously running and reconfigures it
- to be used as a typical watchdog timer, generating a reset
- interrupt upon counter overflow. To prevent this from happening,
- the user should be periodically resetting the counter.
-
- \note
- Keep in mind the speed of the WDT. With a range of 41us to 5.2ms,
- the WDT will overflow before a single frame in a typical game.
-
- \param initial_count Initial value of the WDT counter (Normally 0)
- \param clk_config Clock divider to set watchdog period
- \param reset_select The type of reset generated upon overflow
-
- \sa wdt_disable()
-*/
-void wdt_enable_watchdog(uint8_t initial_count,
- WDT_CLK_DIV clk_config,
- WDT_RST reset_select);
-
-/** \brief Fetches the counter value
- \ingroup wdt
-
- Returns the current 8-bit value of the WDT counter.
-
- \return Current counter value
-
- \sa wdt_set_counter()
-*/
-uint8_t wdt_get_counter(void);
-
-/** \brief Sets the counter value
- \ingroup wdt
-
- Sets the current 8-bit value of the WDT counter.
-
- \param value New value for the counter
-
- \sa wdt_get_counter(), wdt_pet()
-*/
-void wdt_set_counter(uint8_t value);
-
-/** \brief Resets the counter value
- \ingroup wdt
-
- "Petting" or "kicking" the WDT is the same thing as
- resetting its counter value to 0.
-
- \sa wdt_set_counter()
-*/
-void wdt_pet(void);
-
-/** \brief Disables the WDT
- \ingroup wdt
-
- Disables the WDT if it was previously enabled,
- otherwise does nothing.
-
- \sa wdt_enable_timer(), wdt_enable_watchdog()
-*/
-void wdt_disable(void);
-
-/** \brief Returns whether the WDT is enabled
- \ingroup wdt
-
- Checks to see whether the WDT has been enabled.
-
- \return 1 if enabled, 0 if disabled
-*/
-int wdt_is_enabled(void);
-
-__END_DECLS
-
-#endif /* __ARCH_WDT_H */
+#warning "The `<arch/wdt.h>` header has been moved to `<dc/wdt.h>`."
diff --git a/kernel/arch/dreamcast/include/arch/wdt.h b/kernel/arch/dreamcast/include/dc/wdt.h
similarity index 97%
copy from kernel/arch/dreamcast/include/arch/wdt.h
copy to kernel/arch/dreamcast/include/dc/wdt.h
index ece78b4b..00afbc64 100644
--- a/kernel/arch/dreamcast/include/arch/wdt.h
+++ b/kernel/arch/dreamcast/include/dc/wdt.h
@@ -1,11 +1,11 @@
/* KallistiOS ##version##
- arch/dreamcast/include/wdt.h
+ kernel/arch/dreamcast/include/dc/wdt.h
Copyright (C) 2023 Falco Girgis
*/
-/** \file arch/wdt.h
+/** \file dc/wdt.h
\brief Watchdog Timer API
\ingroup wdt
@@ -18,8 +18,8 @@
\author Falco Girgis
*/
-#ifndef __ARCH_WDT_H
-#define __ARCH_WDT_H
+#ifndef __DC_WDT_H
+#define __DC_WDT_H
#include <kos/cdefs.h>
__BEGIN_DECLS
@@ -194,4 +194,4 @@ int wdt_is_enabled(void);
__END_DECLS
-#endif /* __ARCH_WDT_H */
+#endif /* __DC_WDT_H */
diff --git a/kernel/arch/dreamcast/kernel/Makefile b/kernel/arch/dreamcast/kernel/Makefile
index f3dabe6c..d6c3da9f 100644
--- a/kernel/arch/dreamcast/kernel/Makefile
+++ b/kernel/arch/dreamcast/kernel/Makefile
@@ -10,7 +10,7 @@
# that minimum set must be present.
COPYOBJS = banner.o cache.o entry.o irq.o init.o mm.o panic.o
-COPYOBJS += rtc.o timer.o wdt.o perfctr.o perf_monitor.o
+COPYOBJS += rtc.o timer.o perfctr.o perf_monitor.o
COPYOBJS += init_flags_default.o
COPYOBJS += mmu.o itlb.o
COPYOBJS += exec.o execasm.o stack.o gdb_stub.o thdswitch.o tls_static.o arch_exports.o
diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c
index 9ad3b7e9..4c05733f 100644
--- a/kernel/arch/dreamcast/kernel/init.c
+++ b/kernel/arch/dreamcast/kernel/init.c
@@ -19,12 +19,12 @@
#include <arch/memory.h>
#include <arch/rtc.h>
#include <arch/timer.h>
-#include <arch/wdt.h>
#include <dc/perfctr.h>
#include <dc/ubc.h>
#include <dc/pvr.h>
#include <dc/vmufs.h>
#include <dc/syscalls.h>
+#include <dc/wdt.h>
#include "initall_hdrs.h"
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-26 18:17:57
|
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 7bd48056e76e750d1c90e0cc4aeb156f46da31f8 (commit)
via 20819a1c4b039cc3a64e3aadeea6485337776612 (commit)
via 3545637cfa0013c120501326f68a984283290e25 (commit)
via eaf857d4f450e8f7a058950215f4901b3a4bb6c9 (commit)
from 959ce90028b86a0595c1392bf5e549d955bc1071 (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 7bd48056e76e750d1c90e0cc4aeb156f46da31f8
Author: QuzarDC <qu...@co...>
Date: Mon Aug 25 17:50:57 2025 -0400
pvrtex: Provide compatibility for systems without `sincosf`
commit 20819a1c4b039cc3a64e3aadeea6485337776612
Author: QuzarDC <qu...@co...>
Date: Mon Aug 25 14:40:37 2025 -0400
pvrtex: Reimplement #749
commit 3545637cfa0013c120501326f68a984283290e25
Author: QuzarDC <qu...@co...>
Date: Mon Aug 25 13:49:10 2025 -0400
pvrtex: Reimplement fixes from #791 and #789.
commit eaf857d4f450e8f7a058950215f4901b3a4bb6c9
Author: QuzarDC <qu...@co...>
Date: Mon Aug 25 11:29:03 2025 -0400
pvrtex: Clean up whitespace
-----------------------------------------------------------------------
Summary of changes:
utils/pvrtex/Makefile | 28 ++--
utils/pvrtex/dither.cpp | 74 +++++------
utils/pvrtex/file_common.c | 24 ++--
utils/pvrtex/file_dctex.c | 40 +++---
utils/pvrtex/file_dctex.h | 154 +++++++++++-----------
utils/pvrtex/file_pvr.c | 78 +++++------
utils/pvrtex/file_tex.c | 28 ++--
utils/pvrtex/main.c | 74 +++++------
utils/pvrtex/mem.c | 2 +-
utils/pvrtex/nvmath.h | 86 +++++++------
utils/pvrtex/palette.c | 28 ++--
utils/pvrtex/pixel.h | 38 +++---
utils/pvrtex/pvr_texture.c | 90 ++++++-------
utils/pvrtex/pvr_texture.h | 10 +-
utils/pvrtex/pvr_texture_decoder.c | 44 +++----
utils/pvrtex/pvr_texture_decoder.h | 14 +-
utils/pvrtex/pvr_texture_encoder.c | 256 ++++++++++++++++++-------------------
utils/pvrtex/pvr_texture_encoder.h | 68 +++++-----
utils/pvrtex/tddither.c | 40 +++---
utils/pvrtex/vqcompress.c | 42 +++---
utils/pvrtex/vqcompress.h | 6 +-
21 files changed, 614 insertions(+), 610 deletions(-)
diff --git a/utils/pvrtex/Makefile b/utils/pvrtex/Makefile
index b6bd20bc..8f3cced0 100644
--- a/utils/pvrtex/Makefile
+++ b/utils/pvrtex/Makefile
@@ -7,15 +7,17 @@ OBJS = elbg.o mem.o log.o bprint.o avstring.o lfg.o crc.o md5.o stb_image_impl.o
dither.o tddither.o vqcompress.o mycommon.o palette.o file_common.o \
file_pvr.o file_tex.o file_dctex.o pvr_texture_encoder.o pvr_texture_decoder.o main.o
+
+CPPFLAGS = -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0
+CXXFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare
+
ifeq ($(DEBUGBUILD), true)
-OPTMODE= -Og -pg -g
+ CXXFLAGS += -Og -pg -g
else
-OPTMODE= -O3 -flto=auto -march=native
+ CXXFLAGS += -O3
endif
-MYFLAGS=-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0
-MYCPPFLAGS=$(MYFLAGS)
-MYCFLAGS=$(MYFLAGS) -Wno-pointer-sign
+CFLAGS := $(CXXFLAGS) -Wno-pointer-sign -std=gnu17
define textSegment2Header
mkdir -p info
@@ -24,22 +26,15 @@ define textSegment2Header
rm $2/$3.txt
endef
+.PHONY: all clean
+
all: $(TARGET) README
-.PHONY: all clean install
+$(TARGET): $(OBJS)
+ $(CXX) $(CXXFLAGS) -o $@ $^
main.o: main.c info/options.h info/examples.h
-%.o: %.c
- gcc $(CFLAGS) $(MYCFLAGS) $(OPTMODE) -c $< -o $@
-
-%.o: %.cpp
- gcc $(CFLAGS) $(MYCPPFLAGS) $(CXXFLAGS) $(OPTMODE) -c $< -o $@
-
-$(TARGET): $(OBJS)
- gcc $(OPTMODE) -o $(TARGET) \
- $(OBJS) $(PROGMAIN) -lm -lstdc++
-
clean:
rm -f $(TARGET) $(OBJS) README
@@ -49,7 +44,6 @@ README: readme_unformatted.txt
install: all
install -m 755 $(TARGET) $(DC_TOOLS_BASE)/
-
info/options.h: README Makefile
$(call textSegment2Header,Command Line Options:,info,options)
diff --git a/utils/pvrtex/dither.cpp b/utils/pvrtex/dither.cpp
index 054762fa..5c09de5b 100644
--- a/utils/pvrtex/dither.cpp
+++ b/utils/pvrtex/dither.cpp
@@ -22,20 +22,20 @@ class KDTree {
public:
struct KDPoint {
double coord[K];
-
+
KDPoint() { }
-
+
KDPoint(double a,double b,double c) {
coord[0] = a;
coord[1] = b;
coord[2] = c;
}
-
+
KDPoint(double v[K]) {
for(unsigned n=0; n<K; ++n)
coord[n] = v[n];
}
-
+
bool operator==(const KDPoint& b) const {
for(unsigned n=0; n<K; ++n)
if(coord[n] != b.coord[n]) return false;
@@ -53,7 +53,7 @@ public:
private:
struct KDRect {
KDPoint min, max;
-
+
KDPoint bound(const KDPoint& t) const {
KDPoint p;
for(unsigned i=0; i<K; ++i)
@@ -72,7 +72,7 @@ private:
}
}
};
-
+
struct KDNode {
KDPoint k;
V v;
@@ -80,12 +80,12 @@ private:
public:
KDNode() : k(),v(),left(0),right(0) { }
KDNode(const KDPoint& kk, const V& vv) : k(kk), v(vv), left(0), right(0) { }
-
+
virtual ~KDNode() {
delete (left);
delete (right);
}
-
+
static KDNode* ins( const KDPoint& key, const V& val,
KDNode*& t, int lev) {
if(!t)
@@ -110,14 +110,14 @@ private:
Nearest& nearest) {
// 1. if kd is empty then set dist-sqd to infinity and exit.
if (!kd) return;
-
+
// 2. s := split field of kd
int s = lev % K;
-
+
// 3. pivot := dom-elt field of kd
const KDPoint& pivot = kd->k;
double pivot_to_target = pivot.sqrdist(target);
-
+
// 4. Cut hr into to sub-hyperrectangles left-hr and right-hr.
// The cut plane is through pivot and perpendicular to the s
// dimension.
@@ -125,15 +125,15 @@ private:
KDRect right_hr = hr;
left_hr.max.coord[s] = pivot.coord[s];
right_hr.min.coord[s] = pivot.coord[s];
-
+
// 5. target-in-left := target_s <= pivot_s
bool target_in_left = target.coord[s] < pivot.coord[s];
-
+
const KDNode* nearer_kd;
const KDNode* further_kd;
KDRect nearer_hr;
KDRect further_hr;
-
+
// 6. if target-in-left then nearer is left, further is right
if (target_in_left) {
nearer_kd = kd->left;
@@ -148,12 +148,12 @@ private:
further_kd = kd->left;
further_hr = left_hr;
}
-
+
// 8. Recursively call Nearest Neighbor with parameters
// (nearer-kd, target, nearer-hr, max-dist-sqd), storing the
// results in nearest and dist-sqd
nnbr(nearer_kd, target, nearer_hr, lev + 1, nearest);
-
+
// 10. A nearer point could only lie in further-kd if there were some
// part of further-hr within distance sqrt(max-dist-sqd) of
// target. If this is the case then
@@ -166,7 +166,7 @@ private:
// 10.1.2 dist-sqd = (pivot-target)^2
nearest.dist_sqd = pivot_to_target;
}
-
+
// 10.2 Recursively call Nearest Neighbor with parameters
// (further-kd, target, further-hr, max-dist_sqd)
nnbr(further_kd, target, further_hr, lev + 1, nearest);
@@ -192,15 +192,15 @@ public:
virtual ~KDTree() {
delete (m_root);
}
-
+
bool insert(const KDPoint& key, const V& val) {
return KDNode::ins(key, val, m_root, 0);
}
-
+
const std::pair<V,double> nearest(const KDPoint& key) const {
KDRect hr;
hr.MakeInfinite();
-
+
typename KDNode::Nearest nn;
nn.kd = 0;
nn.dist_sqd = 1e99;
@@ -255,7 +255,7 @@ static const double illum[3*3] = {
};
struct LabItem { // CIE L*a*b* color value with C and h added.
double L,a,b,C,h;
-
+
LabItem() { }
LabItem(double R,double G,double B) {
Set(R,G,B);
@@ -302,7 +302,7 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
double a2 = (1.0 + G) * lab2.a;
C1 = sqrt(a1 * a1 + lab1.b * lab1.b);
C2 = sqrt(a2 * a2 + lab2.b * lab2.b);
-
+
if (C1 < 1e-9)
h1 = 0.0;
else {
@@ -310,7 +310,7 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
if (h1 < 0.0)
h1 += 360.0;
}
-
+
if (C2 < 1e-9)
h2 = 0.0;
else {
@@ -319,7 +319,7 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
h2 += 360.0;
}
}
-
+
/* Compute delta L, C and H */
double dL = lab2.L - lab1.L, dC = C2 - C1, dH;
{
@@ -331,10 +331,10 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
/**/ if (dh > 180.0) dh -= 360.0;
else if (dh < -180.0) dh += 360.0;
}
-
+
dH = 2.0 * sqrt(C1 * C2) * sin(DEG2RAD(0.5 * dh));
}
-
+
double h;
double L = 0.5 * (lab1.L + lab2.L);
double C = 0.5 * (C1 + C2);
@@ -401,36 +401,36 @@ MixingPlan DeviseBestMixingPlan(unsigned color, size_t limit) {
(int)((color>>8)&0xFF),
(int)(color&0xFF)
};
-
+
// Input color in CIE L*a*b*
LabItem input(color);
-
+
// Tally so far (gamma-corrected)
double so_far[3] = { 0,0,0 };
-
+
MixingPlan result;
while(result.size() < limit) {
unsigned chosen_amount = 1;
unsigned chosen = 0;
-
+
const unsigned max_test_count = result.empty() ? 1 : result.size();
-
+
double least_penalty = -1;
for(unsigned index=0; index<palettesize; ++index) {
//~ const unsigned color = pal[index];
double sum[3] = { so_far[0], so_far[1], so_far[2] };
double add[3] = { pal_g[index][0], pal_g[index][1], pal_g[index][2] };
-
+
for(unsigned p=1; p<=max_test_count; p*=2) {
for(unsigned c=0; c<3; ++c) sum[c] += add[c];
for(unsigned c=0; c<3; ++c) add[c] += add[c];
double t = result.size() + p;
-
+
double test[3] = { GammaUncorrect(sum[0]/t),
GammaUncorrect(sum[1]/t),
GammaUncorrect(sum[2]/t)
};
-
+
#if COMPARE_RGB
double penalty = ColorCompare(
input_rgb[0],input_rgb[1],input_rgb[2],
@@ -446,10 +446,10 @@ MixingPlan DeviseBestMixingPlan(unsigned color, size_t limit) {
}
}
}
-
+
// Append "chosen_amount" times "chosen" to the color list
result.resize(result.size() + chosen_amount, chosen);
-
+
for(unsigned c=0; c<3; ++c)
so_far[c] += pal_g[chosen][c] * chosen_amount;
}
@@ -462,7 +462,7 @@ int main(int argc, char**argv) {
FILE* fp = fopen(argv[1], "rb");
gdImagePtr srcim = gdImageCreateFromPng(fp);
fclose(fp);
-
+
unsigned w = gdImageSX(srcim), h = gdImageSY(srcim);
gdImagePtr im = gdImageCreate(w, h);
for(unsigned c=0; c<palettesize; ++c) {
diff --git a/utils/pvrtex/file_common.c b/utils/pvrtex/file_common.c
index aa527871..8049bce3 100644
--- a/utils/pvrtex/file_common.c
+++ b/utils/pvrtex/file_common.c
@@ -29,19 +29,19 @@ void Write16LE(unsigned int val, FILE *f) {
}
void WritePadZero(size_t len, FILE *f) {
static char paddingarea[64] = {0};
-
+
assert(f);
assert(len < sizeof(paddingarea));
-
+
CheckedFwrite(&paddingarea, len, f);
}
void WritePvrTexEncoder(const PvrTexEncoder *pte, FILE *f, ptewSmallVQType svq, int mip_skip) {
assert(pte);
assert(pte->pvr_tex);
assert(f);
-
+
unsigned texsize = CalcTextureSize(pte->w, pte->h, pte->pixel_format, pteHasMips(pte), pteIsCompressed(pte), 0);
-
+
if (pteIsCompressed(pte)) {
assert(pte->pvr_codebook);
@@ -52,7 +52,7 @@ void WritePvrTexEncoder(const PvrTexEncoder *pte, FILE *f, ptewSmallVQType svq,
pteLog(LOG_DEBUG, "Writing %u bytes for codebook\n", (unsigned)cbsize);
CheckedFwrite(pte->pvr_codebook + pte->pvr_idx_offset * PVR_CODEBOOK_ENTRY_SIZE_BYTES, cbsize, f);
}
-
+
if (!pteIsCompressed(pte) && pteHasMips(pte)) {
CheckedFwrite(pte->pvr_tex + mip_skip, texsize-mip_skip, f);
} else {
@@ -62,7 +62,7 @@ void WritePvrTexEncoder(const PvrTexEncoder *pte, FILE *f, ptewSmallVQType svq,
int FileSize(const char *fname) {
assert(fname);
-
+
FILE *f = fopen(fname, "r");
if (f == NULL)
return -1;
@@ -74,21 +74,21 @@ int FileSize(const char *fname) {
size_t Slurp(const char *fname, void **data) {
assert(fname);
-
+
FILE *f = fopen(fname, "r");
if (f == NULL)
return 0;
-
+
fseek(f, 0, SEEK_END);
int size = ftell(f);
-
+
fseek(f, 0, SEEK_SET);
-
+
SMART_ALLOC(data, size);
size_t readamt = fread(*data, 1, size, f);
-
+
fclose(f);
-
+
return readamt;
}
diff --git a/utils/pvrtex/file_dctex.c b/utils/pvrtex/file_dctex.c
index 6216217e..af66def2 100644
--- a/utils/pvrtex/file_dctex.c
+++ b/utils/pvrtex/file_dctex.c
@@ -22,35 +22,35 @@ static int convert_size(int size) {
return 1;
else
return 0;
-
+
}
void fDtWrite(const PvrTexEncoder *pte, const char *outfname) {
assert(pte);
-
+
FILE *f = fopen(outfname, "w");
assert(f);
-
+
unsigned textype = 0;
textype |= pteHasMips(pte) << FDT_MIPMAP_SHIFT;
textype |= pteIsCompressed(pte) << FDT_VQ_SHIFT;
textype |= pte->hw_pixel_format << FDT_PIXEL_FORMAT_SHIFT;
textype |= !pte->raw_is_twiddled << FDT_NOT_TWIDDLED_SHIFT;
-
+
//If the width is a power of two, we don't need the stride bit set
textype |= (pteIsStrided(pte) && !IsPow2(pte->w)) << FDT_STRIDE_SHIFT;
-
+
textype |= ((pte->w / 32) & FDT_STRIDE_VAL_MASK) << FDT_STRIDE_VAL_SHIFT;
textype |= !IsPow2(pte->h) << FDT_PARTIAL_SHIFT;
textype |= convert_size(pte->w) << FDT_WIDTH_SHIFT;
textype |= convert_size(pte->h) << FDT_HEIGHT_SHIFT;
-
+
//Include size of header
unsigned origsize = 32 + CalcTextureSize(pte->w, pte->h, pte->pixel_format, pteHasMips(pte), pteIsCompressed(pte), pte->codebook_size * 8);
unsigned size = ROUND_UP_POW2(origsize, 32);
unsigned paddingamt = size - origsize;
pteLog(LOG_DEBUG, "File size: %u orig + %u pad = %u total\n", origsize, paddingamt, size);
-
+
WriteFourCC("DcTx", f);
Write32LE(size, f);
Write8(0, f); //Version
@@ -63,17 +63,17 @@ void fDtWrite(const PvrTexEncoder *pte, const char *outfname) {
Write32LE(0, f);
Write32LE(0, f);
Write32LE(0, f);
-
+
WritePvrTexEncoder(pte, f, PTEW_FILE_DCTEX_SMALL_VQ, 0);
-
+
//Pad to 32 bytes
WritePadZero(paddingamt, f);
fclose(f);
-
+
//Validate resulting file
unsigned resultsize = FileSize(outfname);
ErrorExitOn(resultsize != size, "Size of file written for \"%s\" was incorrect. Expected file to be %u bytes, but result was %u bytes.\n", outfname, size, resultsize);
-
+
f = fopen(outfname, "r");
void *readbuff = malloc(size);
if (fread(readbuff, size, 1, f) == 1) {
@@ -91,24 +91,24 @@ void fDtWrite(const PvrTexEncoder *pte, const char *outfname) {
int fDtLoad(const char *fname, PvrTexDecoder *dst) {
assert(fname);
assert(dst);
-
+
void *data = NULL;
size_t size = Slurp(fname, &data);
-
+
if (size == 0 || data == 0)
goto err_exit;
-
+
fDtHeader *hdr = data;
if (size < sizeof(*hdr) || fDtGetTotalSize(hdr) < size) {
pteLog(LOG_WARNING, ".PVR file appears invalid (incomplete file?)\n");
goto err_exit;
}
-
+
if (!fDtValidateHeader(hdr)) {
pteLog(LOG_WARNING, ".DT file appears corrupt\n");
goto err_exit;
}
-
...<truncated>...
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-25 14:02:28
|
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 959ce90028b86a0595c1392bf5e549d955bc1071 (commit)
from efd7da8be7fa2808899d3bcaa86cd29c3b56262f (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 959ce90028b86a0595c1392bf5e549d955bc1071
Author: dfchil <dan...@gm...>
Date: Mon Aug 25 16:02:08 2025 +0200
updated pvrtex tool to version 2, per the latest release from TapamN (#1145)
Co-authored-by: drxl <da...@vm...>
https://dcemulation.org/phpBB/viewtopic.php?p=1061943#p1061943
-----------------------------------------------------------------------
Summary of changes:
utils/pvrtex/CHANGELOG | 27 +-
utils/pvrtex/Makefile | 40 +-
.../texture.dt | Bin 43744 -> 43744 bytes
utils/pvrtex/avstring.c | 1 +
addons/lib/.keepme => utils/pvrtex/config.h | 0
utils/pvrtex/crc.c | 2 +
utils/pvrtex/dither.cpp | 85 +-
utils/pvrtex/elbg.c | 9 +-
utils/pvrtex/file_common.c | 34 +-
utils/pvrtex/file_common.h | 2 +
utils/pvrtex/file_dctex.c | 74 +-
utils/pvrtex/file_dctex.h | 160 +-
utils/pvrtex/file_pvr.c | 198 +-
utils/pvrtex/file_pvr.h | 3 +
utils/pvrtex/file_tex.c | 32 +-
utils/pvrtex/libavutil/internal.h | 1 +
utils/pvrtex/libavutil/thread.h | 2 +
utils/pvrtex/log.c | 2 +
utils/pvrtex/main.c | 175 +-
utils/pvrtex/mem.c | 4 +-
utils/pvrtex/nvmath.h | 374 +++-
utils/pvrtex/palette.c | 85 +
utils/pvrtex/pixel.h | 79 +-
utils/pvrtex/pvr_texture.c | 123 +-
utils/pvrtex/pvr_texture.h | 24 +-
utils/pvrtex/pvr_texture_decoder.c | 166 ++
utils/pvrtex/pvr_texture_decoder.h | 45 +
utils/pvrtex/pvr_texture_encoder.c | 529 +++---
utils/pvrtex/pvr_texture_encoder.h | 111 +-
utils/pvrtex/pvrtex-completion.bash | 64 +
utils/pvrtex/readme_unformatted.txt | 147 +-
utils/pvrtex/stb_ds.h | 1895 ++++++++++++++++++++
utils/pvrtex/tddither.c | 66 +-
utils/pvrtex/tddither.h | 5 +-
utils/pvrtex/vqcompress.c | 65 +-
utils/pvrtex/vqcompress.h | 6 +-
36 files changed, 3851 insertions(+), 784 deletions(-)
copy addons/lib/.keepme => utils/pvrtex/config.h (100%)
create mode 100644 utils/pvrtex/palette.c
create mode 100644 utils/pvrtex/pvr_texture_decoder.c
create mode 100644 utils/pvrtex/pvr_texture_decoder.h
create mode 100755 utils/pvrtex/pvrtex-completion.bash
create mode 100644 utils/pvrtex/stb_ds.h
diff --git a/utils/pvrtex/CHANGELOG b/utils/pvrtex/CHANGELOG
index 7c51f43c..ed5e2d17 100644
--- a/utils/pvrtex/CHANGELOG
+++ b/utils/pvrtex/CHANGELOG
@@ -1,16 +1,35 @@
Based on code by TapamN
Source released here: https://dcemulation.org/phpBB/viewtopic.php?t=106138
- Version 1.0
- Initial release
+ Version 2.00
+ Mipmaps can now be generationed optionally only if
+ texture is already square, using "--mip-resize opt".
+
+ .PVR and .DT files can be used as input files.
+
+ Custom palettes can be specified with --palette option.
+
+ Option to generate texconv style normal maps.
+
+ Added flip-v option.
+
+ Texture size is printed when --verbose is enabled.
+
+ Speed optimizations.
Version 1.01
- Program now displays error message when an error occurs loading a source image. Previously, the program would hit an assertion.
+ Program now displays error message when an error occurs
+ loading a source image. Previously, the program would
+ hit an assertion.
- Fixed "--resize down" option. Previously, the program would round down sizes that were already a power-of-two, now sizes that are already POT are left unchanged.
+ Fixed "--resize down" option. Previously, the program
+ would round down sizes that were already a power-of-two,
+ now sizes that are already POT are left unchanged.
Included a missing FFmpeg header file.
+ Version 1.0
+ Initial release
---------------------------
Adaption into KOS by Daniel Fairchild, 2024
diff --git a/utils/pvrtex/Makefile b/utils/pvrtex/Makefile
index 87586755..b6bd20bc 100644
--- a/utils/pvrtex/Makefile
+++ b/utils/pvrtex/Makefile
@@ -4,19 +4,18 @@
TARGET = pvrtex
OBJS = elbg.o mem.o log.o bprint.o avstring.o lfg.o crc.o md5.o stb_image_impl.o \
stb_image_write_impl.o stb_image_resize_impl.o optparse_impl.o pvr_texture.o \
- dither.o tddither.o vqcompress.o mycommon.o file_common.o \
- file_pvr.o file_tex.o file_dctex.o pvr_texture_encoder.o main.o
+ dither.o tddither.o vqcompress.o mycommon.o palette.o file_common.o \
+ file_pvr.o file_tex.o file_dctex.o pvr_texture_encoder.o pvr_texture_decoder.o main.o
-CPPFLAGS = -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0
-CXXFLAGS = -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare
-
-ifdef $(DEBUGBUILD)
- CXXFLAGS += -Og -pg -g
+ifeq ($(DEBUGBUILD), true)
+OPTMODE= -Og -pg -g
else
- CXXFLAGS += -O3
+OPTMODE= -O3 -flto=auto -march=native
endif
-CFLAGS := $(CXXFLAGS) -Wno-pointer-sign -std=gnu17
+MYFLAGS=-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0
+MYCPPFLAGS=$(MYFLAGS)
+MYCFLAGS=$(MYFLAGS) -Wno-pointer-sign
define textSegment2Header
mkdir -p info
@@ -25,15 +24,22 @@ define textSegment2Header
rm $2/$3.txt
endef
-.PHONY: all clean
-
all: $(TARGET) README
-$(TARGET): $(OBJS)
- $(CXX) $(CXXFLAGS) -o $@ $^
+.PHONY: all clean install
main.o: main.c info/options.h info/examples.h
+%.o: %.c
+ gcc $(CFLAGS) $(MYCFLAGS) $(OPTMODE) -c $< -o $@
+
+%.o: %.cpp
+ gcc $(CFLAGS) $(MYCPPFLAGS) $(CXXFLAGS) $(OPTMODE) -c $< -o $@
+
+$(TARGET): $(OBJS)
+ gcc $(OPTMODE) -o $(TARGET) \
+ $(OBJS) $(PROGMAIN) -lm -lstdc++
+
clean:
rm -f $(TARGET) $(OBJS) README
@@ -43,8 +49,16 @@ README: readme_unformatted.txt
install: all
install -m 755 $(TARGET) $(DC_TOOLS_BASE)/
+
info/options.h: README Makefile
$(call textSegment2Header,Command Line Options:,info,options)
info/examples.h: README Makefile
$(call textSegment2Header,Usage Examples:,info,examples)
+
+bash-completion-dir:
+ mkdir -p ~/.local/share/bash-completion/completions
+
+
+install-bash-completion: bash-completion-dir
+ install pvrtex-completion.bash ~/.local/share/bash-completion/completions/pvrtex.bash
diff --git a/utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_normal_-m/texture.dt b/utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_normal_-m/texture.dt
index 93df029c..6eaba52d 100644
Binary files a/utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_normal_-m/texture.dt and b/utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_normal_-m/texture.dt differ
diff --git a/utils/pvrtex/avstring.c b/utils/pvrtex/avstring.c
index 99f06690..e460b5be 100644
--- a/utils/pvrtex/avstring.c
+++ b/utils/pvrtex/avstring.c
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <string.h>
+#include "config.h"
#include "mem.h"
#include "avassert.h"
#include "avstring.h"
diff --git a/addons/lib/.keepme b/utils/pvrtex/config.h
similarity index 100%
copy from addons/lib/.keepme
copy to utils/pvrtex/config.h
diff --git a/utils/pvrtex/crc.c b/utils/pvrtex/crc.c
index 4ce8f96d..703b56f4 100644
--- a/utils/pvrtex/crc.c
+++ b/utils/pvrtex/crc.c
@@ -18,6 +18,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "config.h"
+
#include "thread.h"
#include "avassert.h"
#include "bswap.h"
diff --git a/utils/pvrtex/dither.cpp b/utils/pvrtex/dither.cpp
index b195bd11..054762fa 100644
--- a/utils/pvrtex/dither.cpp
+++ b/utils/pvrtex/dither.cpp
@@ -22,20 +22,20 @@ class KDTree {
public:
struct KDPoint {
double coord[K];
-
+
KDPoint() { }
-
+
KDPoint(double a,double b,double c) {
coord[0] = a;
coord[1] = b;
coord[2] = c;
}
-
+
KDPoint(double v[K]) {
for(unsigned n=0; n<K; ++n)
coord[n] = v[n];
}
-
+
bool operator==(const KDPoint& b) const {
for(unsigned n=0; n<K; ++n)
if(coord[n] != b.coord[n]) return false;
@@ -53,7 +53,7 @@ public:
private:
struct KDRect {
KDPoint min, max;
-
+
KDPoint bound(const KDPoint& t) const {
KDPoint p;
for(unsigned i=0; i<K; ++i)
@@ -72,7 +72,7 @@ private:
}
}
};
-
+
struct KDNode {
KDPoint k;
V v;
@@ -80,12 +80,12 @@ private:
public:
KDNode() : k(),v(),left(0),right(0) { }
KDNode(const KDPoint& kk, const V& vv) : k(kk), v(vv), left(0), right(0) { }
-
+
virtual ~KDNode() {
delete (left);
delete (right);
}
-
+
static KDNode* ins( const KDPoint& key, const V& val,
KDNode*& t, int lev) {
if(!t)
@@ -110,14 +110,14 @@ private:
Nearest& nearest) {
// 1. if kd is empty then set dist-sqd to infinity and exit.
if (!kd) return;
-
+
// 2. s := split field of kd
int s = lev % K;
-
+
// 3. pivot := dom-elt field of kd
const KDPoint& pivot = kd->k;
double pivot_to_target = pivot.sqrdist(target);
-
+
// 4. Cut hr into to sub-hyperrectangles left-hr and right-hr.
// The cut plane is through pivot and perpendicular to the s
// dimension.
@@ -125,15 +125,15 @@ private:
KDRect right_hr = hr;
left_hr.max.coord[s] = pivot.coord[s];
right_hr.min.coord[s] = pivot.coord[s];
-
+
// 5. target-in-left := target_s <= pivot_s
bool target_in_left = target.coord[s] < pivot.coord[s];
-
+
const KDNode* nearer_kd;
const KDNode* further_kd;
KDRect nearer_hr;
KDRect further_hr;
-
+
// 6. if target-in-left then nearer is left, further is right
if (target_in_left) {
nearer_kd = kd->left;
@@ -148,12 +148,12 @@ private:
further_kd = kd->left;
further_hr = left_hr;
}
-
+
// 8. Recursively call Nearest Neighbor with parameters
// (nearer-kd, target, nearer-hr, max-dist-sqd), storing the
// results in nearest and dist-sqd
nnbr(nearer_kd, target, nearer_hr, lev + 1, nearest);
-
+
// 10. A nearer point could only lie in further-kd if there were some
// part of further-hr within distance sqrt(max-dist-sqd) of
// target. If this is the case then
@@ -166,7 +166,7 @@ private:
// 10.1.2 dist-sqd = (pivot-target)^2
nearest.dist_sqd = pivot_to_target;
}
-
+
// 10.2 Recursively call Nearest Neighbor with parameters
// (further-kd, target, further-hr, max-dist_sqd)
nnbr(further_kd, target, further_hr, lev + 1, nearest);
@@ -192,15 +192,15 @@ public:
virtual ~KDTree() {
delete (m_root);
}
-
+
bool insert(const KDPoint& key, const V& val) {
return KDNode::ins(key, val, m_root, 0);
}
-
+
const std::pair<V,double> nearest(const KDPoint& key) const {
KDRect hr;
hr.MakeInfinite();
-
+
typename KDNode::Nearest nn;
nn.kd = 0;
nn.dist_sqd = 1e99;
@@ -226,6 +226,17 @@ public:
#define COMPARE_RGB 1
+/* 8x8 threshold map */
+static const unsigned char map[8*8] = {
+ 0,48,12,60, 3,51,15,63,
+ 32,16,44,28,35,19,47,31,
+ 8,56, 4,52,11,59, 7,55,
+ 40,24,36,20,43,27,39,23,
+ 2,50,14,62, 1,49,13,61,
+ 34,18,46,30,33,17,45,29,
+ 10,58, 6,54, 9,57, 5,53,
+ 42,26,38,22,41,25,37,21
+};
static const double Gamma = 2.2; // Gamma correction we use.
@@ -244,7 +255,7 @@ static const double illum[3*3] = {
};
struct LabItem { // CIE L*a*b* color value with C and h added.
double L,a,b,C,h;
-
+
LabItem() { }
LabItem(double R,double G,double B) {
Set(R,G,B);
@@ -291,7 +302,7 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
double a2 = (1.0 + G) * lab2.a;
C1 = sqrt(a1 * a1 + lab1.b * lab1.b);
C2 = sqrt(a2 * a2 + lab2.b * lab2.b);
-
+
if (C1 < 1e-9)
h1 = 0.0;
else {
@@ -299,7 +310,7 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
if (h1 < 0.0)
h1 += 360.0;
}
-
+
if (C2 < 1e-9)
h2 = 0.0;
else {
@@ -308,7 +319,7 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
h2 += 360.0;
}
}
-
+
/* Compute delta L, C and H */
double dL = lab2.L - lab1.L, dC = C2 - C1, dH;
{
@@ -320,10 +331,10 @@ double ColorCompare(const LabItem& lab1, const LabItem& lab2) {
/**/ if (dh > 180.0) dh -= 360.0;
else if (dh < -180.0) dh += 360.0;
}
-
+
dH = 2.0 * sqrt(C1 * C2) * sin(DEG2RAD(0.5 * dh));
}
-
+
double h;
double L = 0.5 * (lab1.L + lab2.L);
double C = 0.5 * (C1 + C2);
@@ -369,6 +380,10 @@ double ColorCompare(int r1,int g1,int b1, int r2,int g2,int b2) {
/* Palette */
static const unsigned palettesize = 16;
+static const unsigned pal[palettesize] = {
+ 0x080000,0x201A0B,0x432817,0x492910, 0x234309,0x5D4F1E,0x9C6B20,0xA9220F,
+ 0x2B347C,0x2B7409,0xD0CA40,0xE8A077, 0x6A94AB,0xD5C4B3,0xFCE76E,0xFCFAE2
+};
/* Luminance for each palette entry, to be initialized as soon as the program begins */
static unsigned luma[palettesize];
@@ -389,28 +404,28 @@ MixingPlan DeviseBestMixingPlan(unsigned color, size_t limit) {
// Input color in CIE L*a*b*
LabItem input(color);
-
+
// Tally so far (gamma-corrected)
double so_far[3] = { 0,0,0 };
-
+
MixingPlan result;
while(result.size() < limit) {
unsigned chosen_amount = 1;
unsigned chosen = 0;
-
+
const unsigned max_test_count = result.empty() ? 1 : result.size();
-
+
double least_penalty = -1;
for(unsigned index=0; index<palettesize; ++index) {
//~ const unsigned color = pal[index];
double sum[3] = { so_far[0], so_far[1], so_far[2] };
double add[3] = { pal_g[index][0], pal_g[index][1], pal_g[index][2] };
-
+
for(unsigned p=1; p<=max_test_count; p*=2) {
for(unsigned c=0; c<3; ++c) sum[c] += add[c];
for(unsigned c=0; c<3; ++c) add[c] += add[c];
double t = result.size() + p;
-
+
double test[3] = { GammaUncorrect(sum[0]/t),
GammaUncorrect(sum[1]/t),
GammaUncorrect(sum[2]/t)
@@ -431,10 +446,10 @@ MixingPlan DeviseBestMixingPlan(unsigned color, size_t limit) {
}
}
}
-
+
// Append "chosen_amount" times "chosen" to the color list
result.resize(result.size() + chosen_amount, chosen);
-
+
for(unsigned c=0; c<3; ++c)
so_far[c] += pal_g[chosen][c] * chosen_amount;
}
@@ -447,7 +462,7 @@ int main(int argc, char**argv) {
FILE* fp = fopen(argv[1], "rb");
gdImagePtr srcim = gdImageCreateFromPng(fp);
fclose(fp);
-
+
unsigned w = gdImageSX(srcim), h = gdImageSY(srcim);
gdImagePtr im = gdImageCreate(w, h);
for(unsigned c=0; c<palettesize; ++c) {
diff --git a/utils/pvrtex/elbg.c b/utils/pvrtex/elbg.c
index 7a6a84fb..e258ef38 100644
--- a/utils/pvrtex/elbg.c
+++ b/utils/pvrtex/elbg.c
@@ -73,17 +73,20 @@ typedef struct ELBGContext {
static inline int distance_limited(int *a, int *b, int dim, int limit)
{
+ //Changing the conditional allows for auto-vectorization, and does not seem to
+ //have any affect on final result
int i, dist=0;
for (i=0; i<dim; i++) {
int64_t distance = a[i] - b[i];
distance *= distance;
- if (dist >= limit - distance)
- return limit;
+// if (dist >= limit - distance)
+// return limit;
dist += distance;
}
- return dist;
+// return dist;
+ return dist > limit ? limit : dist;
}
static inline void vect_division(int *res, int *vect, int div, int dim)
diff --git a/utils/pvrtex/file_common.c b/utils/pvrtex/file_common.c
index 739de151..aa527871 100644
--- a/utils/pvrtex/file_common.c
+++ b/utils/pvrtex/file_common.c
@@ -29,19 +29,19 @@ void Write16LE(unsigned int val, FILE *f) {
}
void WritePadZero(size_t len, FILE *f) {
static char paddingarea[64] = {0};
-
+
assert(f);
...<truncated>...
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-25 13:53:27
|
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 efd7da8be7fa2808899d3bcaa86cd29c3b56262f (commit)
from cbb2ce8297d47ba5c7f02eacf50724a1f301b2a9 (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 efd7da8be7fa2808899d3bcaa86cd29c3b56262f
Author: QuzarDC <qu...@co...>
Date: Mon Aug 25 02:32:28 2025 -0400
cmake: Fix building of libGL by specifying `ar` and `ranlib` wrappers
-----------------------------------------------------------------------
Summary of changes:
utils/cmake/kallistios.toolchain.cmake | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/utils/cmake/kallistios.toolchain.cmake b/utils/cmake/kallistios.toolchain.cmake
index fac0d677..59d8eed1 100644
--- a/utils/cmake/kallistios.toolchain.cmake
+++ b/utils/cmake/kallistios.toolchain.cmake
@@ -58,6 +58,14 @@ set(CMAKE_CXX_COMPILER ${KOS_BASE}/utils/build_wrappers/kos-c++)
set(CMAKE_OBJC_COMPILER ${KOS_BASE}/utils/build_wrappers/kos-cc)
set(CMAKE_OBJCXX_COMPILER ${KOS_BASE}/utils/build_wrappers/kos-c++)
+set(CMAKE_ASM_COMPILER_AR ${KOS_BASE}/utils/build_wrappers/kos-ar)
+set(CMAKE_C_COMPILER_AR ${KOS_BASE}/utils/build_wrappers/kos-ar)
+set(CMAKE_CXX_COMPILER_AR ${KOS_BASE}/utils/build_wrappers/kos-ar)
+
+set(CMAKE_ASM_COMPILER_RANLIB ${KOS_BASE}/utils/build_wrappers/kos-ranlib)
+set(CMAKE_C_COMPILER_RANLIB ${KOS_BASE}/utils/build_wrappers/kos-ranlib)
+set(CMAKE_CXX_COMPILER_RANLIB ${KOS_BASE}/utils/build_wrappers/kos-ranlib)
+
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
# Never use the CMAKE_FIND_ROOT_PATH to find programs with find_program()
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-25 13:10:44
|
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 cbb2ce8297d47ba5c7f02eacf50724a1f301b2a9 (commit)
from 6c35d8ab363f012bb666a7667351fd5517e5453c (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 cbb2ce8297d47ba5c7f02eacf50724a1f301b2a9
Author: Paul Cercueil <pa...@cr...>
Date: Sun Aug 24 23:15:03 2025 +0200
dc-chain: Fix removal of fake-kos.o from C library
On some systems it appears that the Makefile's $(shell ) function won't
search the extra paths added to a PATH variable overriden inside the
Makefile, even if it is exported.
Address this issue by passing the absolute paths to the tools needed to
remove the fake-kos.o from the C library.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
utils/dc-chain/scripts/gcc-pass2.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/utils/dc-chain/scripts/gcc-pass2.mk b/utils/dc-chain/scripts/gcc-pass2.mk
index f4096fea..6c6750a3 100644
--- a/utils/dc-chain/scripts/gcc-pass2.mk
+++ b/utils/dc-chain/scripts/gcc-pass2.mk
@@ -32,5 +32,7 @@ ifdef enable_ada
endif
endif
$(MAKE) -C $(build) $(install_mode) DESTDIR=$(DESTDIR) $(to_log)
- $(target)-gcc-ar d $(shell $(target)-gcc -print-file-name=libgcc.a) fake-kos.o
+ $(toolchain_path)/bin/$(target)-gcc-ar d \
+ $(shell $(toolchain_path)/bin/$(target)-gcc -print-file-name=libgcc.a) \
+ fake-kos.o $(to_log)
$(clean_up)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-25 13:10:27
|
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 6c35d8ab363f012bb666a7667351fd5517e5453c (commit)
from 97c2028a7d03886cbcebeda31ec91102567e5c77 (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 6c35d8ab363f012bb666a7667351fd5517e5453c
Author: Paul Cercueil <pa...@cr...>
Date: Sat Aug 23 21:54:56 2025 +0200
dc-chain: Use regular KOS includes with C++ in gthr-kos.h
The gthr-kos.h file is not just used during the GCC build to compile the
C library, it is also copied into the toolchain for use with C++.
If we detect C++, then just fall back to including the headers.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
utils/dc-chain/patches/gcc/gthr-kos.h | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/utils/dc-chain/patches/gcc/gthr-kos.h b/utils/dc-chain/patches/gcc/gthr-kos.h
index 8a383ac1..a782348a 100644
--- a/utils/dc-chain/patches/gcc/gthr-kos.h
+++ b/utils/dc-chain/patches/gcc/gthr-kos.h
@@ -40,7 +40,7 @@ __BEGIN_DECLS
#define __GTHREADS_CXX0X 1
#define __GTHREAD_HAS_COND 1
-#ifdef TEST_GTHR_KOS_API
+#if defined(TEST_GTHR_KOS_API) || defined(__cplusplus)
#include <kos/thread.h>
#include <kos/tls.h>
#include <kos/mutex.h>
@@ -54,6 +54,7 @@ __BEGIN_DECLS
#include <stdbool.h>
#include <time.h>
+#if !defined(__cplusplus)
/* KOS types */
struct kthread;
@@ -102,15 +103,6 @@ int cond_wait_timed(condvar_t *cv, mutex_t *m, int timeout) __nonnull_all;
int cond_broadcast(condvar_t *cv) __nonnull_all;
int cond_signal(condvar_t *cv) __nonnull_all;
-/* These should work just fine. */
-typedef kthread_key_t __gthread_key_t;
-typedef kthread_once_t __gthread_once_t;
-typedef mutex_t __gthread_mutex_t;
-typedef mutex_t __gthread_recursive_mutex_t;
-typedef condvar_t __gthread_cond_t;
-typedef kthread_t *__gthread_t;
-typedef struct timespec __gthread_time_t;
-
#define KTHREAD_ONCE_INIT 0
#define MUTEX_TYPE_NORMAL 0
@@ -120,6 +112,17 @@ typedef struct timespec __gthread_time_t;
#define RECURSIVE_MUTEX_INITIALIZER { MUTEX_TYPE_RECURSIVE, NULL, 0 }
#define COND_INITIALIZER { 0 }
+#endif /* !defined(__cplusplus) */
+
+/* These should work just fine. */
+typedef kthread_key_t __gthread_key_t;
+typedef kthread_once_t __gthread_once_t;
+typedef mutex_t __gthread_mutex_t;
+typedef mutex_t __gthread_recursive_mutex_t;
+typedef condvar_t __gthread_cond_t;
+typedef kthread_t *__gthread_t;
+typedef struct timespec __gthread_time_t;
+
#define __GTHREAD_ONCE_INIT KTHREAD_ONCE_INIT
#define __GTHREAD_MUTEX_INIT MUTEX_INITIALIZER
#define __GTHREAD_RECURSIVE_MUTEX_INIT RECURSIVE_MUTEX_INITIALIZER
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-24 08:09:36
|
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 97c2028a7d03886cbcebeda31ec91102567e5c77 (commit)
via 0beaf98146a90f5a7fc48a6fe96b8d898f541cf9 (commit)
via 03e5f0c9473fcb95d9ad7bf0fcf12add92ce6a06 (commit)
from c104291218971b1393760f6605e25422d51f76cd (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 97c2028a7d03886cbcebeda31ec91102567e5c77
Author: Paul Cercueil <pa...@cr...>
Date: Tue Aug 19 15:28:10 2025 +0200
kos-cc: Update list of autotools specific filenames
Autotools (latest versions maybe?) seem to use the filename
'conftest__.c' instead of 'conftest.c' for its test builds.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 0beaf98146a90f5a7fc48a6fe96b8d898f541cf9
Author: Paul Cercueil <pa...@cr...>
Date: Tue Aug 19 15:08:15 2025 +0200
cmake: Speed up CMake configuration, disable LTO for Debug builds
Disable LTO for Debug builds as it does not really make sense to use it
there. Then, we can specify that all the configuration tests done by
CMake will use the Debug profile, which will cause them to be built
without LTO, speeding up the process.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 03e5f0c9473fcb95d9ad7bf0fcf12add92ce6a06
Author: Paul Cercueil <pa...@cr...>
Date: Tue Aug 19 15:06:13 2025 +0200
kos-cc: Speed up autotools configuration
Build autotools-specific tests (detected by their filename) with LTO
explicitly disabled to speed up the process.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
utils/build_wrappers/kos-cc | 14 +++++++++++---
utils/cmake/kallistios.toolchain.cmake | 5 +++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/utils/build_wrappers/kos-cc b/utils/build_wrappers/kos-cc
index 3bb3c289..7365aa09 100755
--- a/utils/build_wrappers/kos-cc
+++ b/utils/build_wrappers/kos-cc
@@ -6,7 +6,7 @@ USEMODE=0
for i in $ARGS; do
case "${i}" in
-o)
- if [ $USEMODE != 2 ]; then
+ if [ $USEMODE != 2 -a $USEMODE != 3 ]; then
# Link
USEMODE=1
fi
@@ -15,10 +15,10 @@ for i in $ARGS; do
# Partial compile
USEMODE=2
;;
- conftest.c | conftest.cc | conftest.cpp)
+ conftest.c | conftest.cc | conftest.cpp | conftest__.c | conftest__.cc | conftest__.cpp)
# Used in autoconf... we really probably need
# a better way to do this. (scan for any .c?)
- USEMODE=1
+ USEMODE=3
;;
*)
;;
@@ -42,6 +42,14 @@ case $USEMODE in
exec ${KOS_CC} ${KOS_CFLAGS} ${KOS_LDFLAGS} "$@" ${KOS_LIBS}
;;
+ 3)
+ # Link mode for autoconf: pass -fno-lto to speed up process
+ if [ x${KOS_WRAPPERS_VERBOSE} = x"1" ]; then
+ echo ${KOS_CC} ${KOS_CFLAGS} ${KOS_LDFLAGS} -fno-lto "$@" ${KOS_LIBS}
+ fi
+ exec ${KOS_CC} ${KOS_CFLAGS} ${KOS_LDFLAGS} -fno-lto "$@" ${KOS_LIBS}
+ ;;
+
2)
# In non-link mode, just go ahead and run CC.
if [ x${KOS_WRAPPERS_VERBOSE} = x"1" ]; then
diff --git a/utils/cmake/kallistios.toolchain.cmake b/utils/cmake/kallistios.toolchain.cmake
index 35c976e0..fac0d677 100644
--- a/utils/cmake/kallistios.toolchain.cmake
+++ b/utils/cmake/kallistios.toolchain.cmake
@@ -78,6 +78,11 @@ add_compile_options(
set(CMAKE_ASM_FLAGS "")
set(CMAKE_ASM_FLAGS_RELEASE "")
+# Disable LTO for Debug build
+set(CMAKE_TRY_COMPILE_CONFIGURATION DEBUG)
+set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG OFF)
+set(CMAKE_EXE_LINKER_FLAGS_DEBUG -fno-lto)
+
# Default CMake installations to install to kos-addons
set(CMAKE_INSTALL_BINDIR ${DC_TOOLS_BASE})
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-24 06:01:36
|
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 c104291218971b1393760f6605e25422d51f76cd (commit)
via 10b3a05001e7744220b1202fc33e0da54f5ca7f1 (commit)
from 88b9a64def662c8648d3dd8a810d5e443a767d49 (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 c104291218971b1393760f6605e25422d51f76cd
Author: darc <da...@pr...>
Date: Tue Aug 19 15:12:00 2025 -0500
arch cleanup: Move default serial baud/FIFO defines to scif.h
commit 10b3a05001e7744220b1202fc33e0da54f5ca7f1
Author: darc <da...@pr...>
Date: Tue Aug 19 15:11:16 2025 -0500
arch cleanup: Move default video/pixel modes to video.h
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/scif.c | 1 +
kernel/arch/dreamcast/include/arch/arch.h | 12 ------------
kernel/arch/dreamcast/include/dc/scif.h | 6 ++++++
kernel/arch/dreamcast/include/dc/video.h | 6 ++++++
4 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/kernel/arch/dreamcast/hardware/scif.c b/kernel/arch/dreamcast/hardware/scif.c
index 70b7254b..41eb0b55 100644
--- a/kernel/arch/dreamcast/hardware/scif.c
+++ b/kernel/arch/dreamcast/hardware/scif.c
@@ -11,6 +11,7 @@
#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 2414f919..dd51f245 100644
--- a/kernel/arch/dreamcast/include/arch/arch.h
+++ b/kernel/arch/dreamcast/include/arch/arch.h
@@ -79,18 +79,6 @@ extern char _etext;
static const
unsigned HZ __depr("Please use the new THD_SCHED_HZ macro.") = THD_SCHED_HZ;
-/** \brief Default video mode. */
-#define DEFAULT_VID_MODE DM_640x480
-
-/** \brief Default pixel mode for video. */
-#define DEFAULT_PIXEL_MODE PM_RGB565
-
-/** \brief Default serial bitrate. */
-#define DEFAULT_SERIAL_BAUD 115200
-
-/** \brief Default serial FIFO behavior. */
-#define DEFAULT_SERIAL_FIFO 1
-
/** \brief Global symbol prefix in ELF files. */
#define ELF_SYM_PREFIX "_"
diff --git a/kernel/arch/dreamcast/include/dc/scif.h b/kernel/arch/dreamcast/include/dc/scif.h
index 5741cbdb..13f6b8ac 100644
--- a/kernel/arch/dreamcast/include/dc/scif.h
+++ b/kernel/arch/dreamcast/include/dc/scif.h
@@ -34,6 +34,12 @@ __BEGIN_DECLS
@{
*/
+/** \brief Default serial bitrate. */
+#define DEFAULT_SERIAL_BAUD 115200
+
+/** \brief Default serial FIFO behavior. */
+#define DEFAULT_SERIAL_FIFO 1
+
/** \brief Set serial parameters.
\param baud The bitrate to set.
\param fifo 1 to enable FIFO mode.
diff --git a/kernel/arch/dreamcast/include/dc/video.h b/kernel/arch/dreamcast/include/dc/video.h
index 440eb48c..1deab2f7 100644
--- a/kernel/arch/dreamcast/include/dc/video.h
+++ b/kernel/arch/dreamcast/include/dc/video.h
@@ -107,6 +107,12 @@ typedef enum vid_display_mode_generic {
*/
#define DM_MULTIBUFFER 0x2000
+/** \brief Default video mode. */
+#define DEFAULT_VID_MODE DM_640x480
+
+/** \brief Default pixel mode for video. */
+#define DEFAULT_PIXEL_MODE PM_RGB565
+
/* ------------------------------------------------------------------------- */
/* More specific modes (and actual indices into the mode table) */
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-24 04:29:39
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 88b9a64def662c8648d3dd8a810d5e443a767d49 (commit)
via 5139543bd089db771a9fb9d14fdc9c14047efa96 (commit)
from a36363f0469e8f95c275338d91dca59f6563b9d4 (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 88b9a64def662c8648d3dd8a810d5e443a767d49
Author: QuzarDC <qu...@co...>
Date: Thu Aug 14 14:12:37 2025 -0400
vmu: Only send beep/clock/lcd commands to official VMUs
These functions are only supported on official VMUs and sending
them to 3rd party devices/VMS can cause hardware errors. To avoid
these we short-circuit if the device wouldn't support the function.
commit 5139543bd089db771a9fb9d14fdc9c14047efa96
Author: QuzarDC <qu...@co...>
Date: Thu Aug 14 13:23:14 2025 -0400
vmu: Detect VMS vs VMU and don't poll VMS units for buttons.
The VMU driver runs three independent devices that coexist in
the VMU: memcard, clock, and lcd. The polling for button presses
is something that is part of the clock device, which is not available
in VMS units which only have the memcard. Since button polling is
done for all devices at the driver level, enabling it would cause
any device that was run by the driver to get sent polls for buttons
even if they do not have buttons/clock.
The change here filters those out to prevent erroring out the device.
Unfortunately merely testing the well-documented `functions` value
that the device reports is not sufficient as most (possibly all) 3rd
party VMS devices just report that they have LCD/Clock even though
they don't. To make it more useful I test against one of the function
data codes that was gathered by experimentation and seems to always
be the same on official units and never present on unofficial ones.
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/hardware/maple/vmu.c | 45 ++++++++++++++++++++++++++--
kernel/arch/dreamcast/include/dc/maple/vmu.h | 7 +++++
2 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/kernel/arch/dreamcast/hardware/maple/vmu.c b/kernel/arch/dreamcast/hardware/maple/vmu.c
index d95a392c..922f1754 100644
--- a/kernel/arch/dreamcast/hardware/maple/vmu.c
+++ b/kernel/arch/dreamcast/hardware/maple/vmu.c
@@ -29,6 +29,30 @@
#define VMU_BLOCK_WRITE_RETRY_TIME 100 /* time to sleep until retrying a failed write */
+/* This is the value that official VMUs report for function_data[0]. Have not
+ found any official ones that report a different value nor any third party
+ that report it.
+*/
+static const uint32_t vmu_official_function_data0 = 0x403f7e7e;
+
+/* Distinguish between VMU (only official, with screen/clock/buttons)
+ and VMS (memcard only). */
+static bool vmu_is_vmu(const maple_device_t *dev) {
+ /* If it doesn't have the known magic number, it's no official VMU. */
+ if(dev->info.function_data[0] != vmu_official_function_data0)
+ return false;
+
+ /* Give a secondary test to confirm that it's presenting all three
+ components of an official VMU. This alone is not sufficient to test
+ for VMU vs VMS though as most (all?) 3rd party VMS report that they
+ have the other functions.
+ */
+ if(dev->info.functions & (MAPLE_FUNC_MEMCARD | MAPLE_FUNC_LCD | MAPLE_FUNC_CLOCK))
+ return true;
+
+ return false;
+}
+
/* VMU's raw condition data: 0 = PRESSED, 1 = RELEASED */
typedef struct vmu_cond {
uint8_t raw_buttons;
@@ -127,8 +151,9 @@ static void vmu_poll_reply(maple_state_t *st, maple_frame_t *frm) {
static int vmu_poll(maple_device_t *dev) {
uint32_t *send_buf;
- /* Only query for button input on the front VMU of each controller. */
- if(dev->unit == 1) {
+ /* Only query for button input on the front VMU of each controller
+ AND the device actually has the functionality. */
+ if((dev->unit == 1) && vmu_is_vmu(dev)) {
if(maple_frame_lock(&dev->frame) < 0)
return 0;
@@ -292,6 +317,10 @@ int vmu_beep_raw(maple_device_t *dev, uint32_t beep) {
assert(dev);
+ /* Only send a beep if this is a real VMU */
+ if(!vmu_is_vmu(dev))
+ return MAPLE_EINVALID;
+
/* Lock the frame */
if(maple_frame_lock(&dev->frame) < 0)
return MAPLE_EAGAIN;
@@ -326,6 +355,10 @@ int vmu_draw_lcd(maple_device_t *dev, const void *bitmap) {
assert(dev != NULL);
+ /* Only try to draw to screen if this is a real VMU */
+ if(!vmu_is_vmu(dev))
+ return MAPLE_EINVALID;
+
/* Lock the frame */
if(maple_frame_lock(&dev->frame) < 0)
return MAPLE_EAGAIN;
@@ -618,6 +651,10 @@ int vmu_set_datetime(maple_device_t *dev, time_t unix) {
assert(dev);
+ /* Only set datetime if this is a real VMU */
+ if(!vmu_is_vmu(dev))
+ return MAPLE_EINVALID;
+
btime = localtime(&unix);
assert(btime); /* A failure here means an invalid unix timestamp was given. */
@@ -668,6 +705,10 @@ int vmu_get_datetime(maple_device_t *dev, time_t *unix) {
assert(dev);
+ /* Only get datetime if this is a real VMU */
+ if(!vmu_is_vmu(dev))
+ return MAPLE_EINVALID;
+
/* Lock the frame */
if(maple_frame_lock(&dev->frame) < 0)
return MAPLE_EAGAIN;
diff --git a/kernel/arch/dreamcast/include/dc/maple/vmu.h b/kernel/arch/dreamcast/include/dc/maple/vmu.h
index 1735d1d3..5ade196b 100644
--- a/kernel/arch/dreamcast/include/dc/maple/vmu.h
+++ b/kernel/arch/dreamcast/include/dc/maple/vmu.h
@@ -253,6 +253,7 @@ int vmu_get_icon_shape(maple_device_t *dev, uint8_t *icon_shape);
\retval MAPLE_EOK On success.
\retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
+ \retval MAPLE_EINVALID The device does not support this functionality (VMS).
\sa vmu_draw_lcd_rotated, vmu_draw_lcd_xbm, vmu_set_icon
*/
@@ -274,6 +275,7 @@ int vmu_draw_lcd(maple_device_t *dev, const void *bitmap);
\param bitmap The bitmap to show.
\retval MAPLE_EOK On success.
\retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
+ \retval MAPLE_EINVALID The device does not support this functionality (VMS).
\sa vmu_draw_lcd, vmu_draw_lcd_xbm, vmu_set_icon
*/
@@ -290,6 +292,7 @@ int vmu_draw_lcd_rotated(maple_device_t *dev, const void *bitmap);
\retval MAPLE_EOK On success.
\retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
+ \retval MAPLE_EINVALID The device does not support this functionality (VMS).
\sa vmu_draw_lcd, vmu_set_icon
*/
@@ -410,6 +413,7 @@ int vmu_block_write(maple_device_t *dev, uint16_t blocknum, const uint8_t *buffe
\retval MAPLE_EOK On success.
\retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
+ \retval MAPLE_EINVALID The device does not support this functionality (VMS).
\sa vmu_beep_waveform
*/
@@ -471,6 +475,7 @@ int vmu_beep_raw(maple_device_t *dev, uint32_t beep);
\retval MAPLE_EOK On success.
\retval MAPLE_EAGAIN If the command couldn't be sent. Try again later.
+ \retval MAPLE_EINVALID The device does not support this functionality (VMS).
*/
int vmu_beep_waveform(maple_device_t *dev, uint8_t period1, uint8_t duty_cycle1, uint8_t period2, uint8_t duty_cycle2);
@@ -493,6 +498,7 @@ int vmu_beep_waveform(maple_device_t *dev, uint8_t period1, uint8_t duty_cycle1,
\retval MAPLE_EOK On success.
\retval MAPLE_ETIMEOUT If the command timed out while blocking.
\retval MAPLE_EFAIL On errors other than timeout.
+ \retval MAPLE_EINVALID The device does not support this functionality (VMS).
\sa vmu_get_datetime
*/
@@ -513,6 +519,7 @@ int vmu_set_datetime(maple_device_t *dev, time_t unix);
\retval MAPLE_EOK On success.
\retval MAPLE_ETIMEOUT If the command timed out while blocking.
\retval MAPLE_EFAIL On errors other than timeout.
+ \retval MAPLE_EINVALID The device does not support this functionality (VMS).
\sa vmu_set_datetime
*/
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-24 03:59:49
|
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 a36363f0469e8f95c275338d91dca59f6563b9d4 (commit)
via 00f6b33af1a410ebbd612157a257fd3e78e22128 (commit)
via 37510ee9a62138a4d38d9e1c40182764ed7b5866 (commit)
via 04b13dba01fa7be9fa1b52ced9b1f7c6908f8d5b (commit)
via 3cdc26e1601eb4b0be90ede61eef9c74c7153429 (commit)
from b0a78dfd2bdad675028b687ba8b7f691d503a15f (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 a36363f0469e8f95c275338d91dca59f6563b9d4
Author: Paul Cercueil <pa...@cr...>
Date: Fri Aug 22 23:21:08 2025 +0200
dc-chain: Prepare gthr-kos.h for inclusion from C++
Make sure the header can be included from C++.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 00f6b33af1a410ebbd612157a257fd3e78e22128
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 20 23:36:57 2025 +0200
Compile-test gthr-kos.h with GCC >= 15
Starting from GCC 15, the C23 standard is supported.
This is important, because this standard allows the redefinition of
types, as long as the new definition matches the type of the old
definition.
Therefore, we can compile the gthr-kos.h header with the
TEST_GTHR_KOS_API macro set, which will cause all the headers that
define the symbols used in there to be included. The effect of that, is
that all the re-defined functions and types in gthr-kos.h will be
compared vs. the original one in KOS headers, and GCC will throw an
error if any of them has a different type or prototype.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 37510ee9a62138a4d38d9e1c40182764ed7b5866
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 20 23:34:22 2025 +0200
dc-chain: Update gthr-kos.h to drop KOS specific includes
Add the prototype of the KOS functions that are bound at the beginning
of the file, without including any of the KOS headers.
Note that irq_disable() / irq_restore() are static inline in
<arch/irq.h>, so there are no symbols that can be bound. However, I do
not see how disabling IRQs is needed there, so I just dropped the
protection.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 04b13dba01fa7be9fa1b52ced9b1f7c6908f8d5b
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 20 23:09:23 2025 +0200
thread: Include missing header in thread.h
<kos/thread.h> was missing an <arch/types.h> include to get the tid_t
and prio_t types.
Signed-off-by: Paul Cercueil <pa...@cr...>
commit 3cdc26e1601eb4b0be90ede61eef9c74c7153429
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 20 22:31:45 2025 +0200
Revert to using <sys/cdefs.h> for sys/ headers
The whole sys/ folder is copied inside the toolchain. Therefore it
should not be using any KOS-specific header.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
include/kos/thread.h | 1 +
include/sys/_pthreadtypes.h | 2 +-
include/sys/_types.h | 2 +-
include/sys/dirent.h | 2 +-
include/sys/ioctl.h | 2 +-
include/sys/lock.h | 2 +-
include/sys/sched.h | 2 +-
include/sys/select.h | 2 +-
include/sys/socket.h | 2 +-
include/sys/stdio.h | 2 +-
include/sys/uio.h | 2 +-
include/sys/utsname.h | 2 +-
kernel/thread/Makefile | 9 ++++-
utils/dc-chain/patches/gcc/gthr-kos.h | 73 +++++++++++++++++++++++++++++++----
14 files changed, 85 insertions(+), 20 deletions(-)
diff --git a/include/kos/thread.h b/include/kos/thread.h
index 23d91f13..22a798ae 100644
--- a/include/kos/thread.h
+++ b/include/kos/thread.h
@@ -41,6 +41,7 @@ __BEGIN_DECLS
#include <kos/cdefs.h>
#include <kos/tls.h>
#include <arch/irq.h>
+#include <arch/types.h>
#include <sys/queue.h>
#include <sys/reent.h>
diff --git a/include/sys/_pthreadtypes.h b/include/sys/_pthreadtypes.h
index 2c25eaba..67d6166d 100644
--- a/include/sys/_pthreadtypes.h
+++ b/include/sys/_pthreadtypes.h
@@ -8,7 +8,7 @@
#ifndef __SYS_PTHREADTYPES_H
#define __SYS_PTHREADTYPES_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
typedef unsigned long int pthread_t;
diff --git a/include/sys/_types.h b/include/sys/_types.h
index 723f3704..5e7a4247 100644
--- a/include/sys/_types.h
+++ b/include/sys/_types.h
@@ -10,7 +10,7 @@
#ifndef _SYS__TYPES_H
#define _SYS__TYPES_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
#include <sys/lock.h>
diff --git a/include/sys/dirent.h b/include/sys/dirent.h
index 61cdbceb..92b29ff4 100644
--- a/include/sys/dirent.h
+++ b/include/sys/dirent.h
@@ -19,7 +19,7 @@
#ifndef __SYS_DIRENT_H
#define __SYS_DIRENT_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
diff --git a/include/sys/ioctl.h b/include/sys/ioctl.h
index 3865c71f..40acd6c2 100644
--- a/include/sys/ioctl.h
+++ b/include/sys/ioctl.h
@@ -20,7 +20,7 @@
#ifndef __SYS_IOCTL_H
#define __SYS_IOCTL_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
diff --git a/include/sys/lock.h b/include/sys/lock.h
index 790a9b36..66529899 100644
--- a/include/sys/lock.h
+++ b/include/sys/lock.h
@@ -19,7 +19,7 @@
#ifndef __SYS_LOCK_H__
#define __SYS_LOCK_H__
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
/** \cond */
diff --git a/include/sys/sched.h b/include/sys/sched.h
index bbd4b593..2e040f62 100644
--- a/include/sys/sched.h
+++ b/include/sys/sched.h
@@ -7,7 +7,7 @@
#ifndef __SYS_SCHED_H
#define __SYS_SCHED_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
// These are copied from Newlib to make stuff compile as expected.
diff --git a/include/sys/select.h b/include/sys/select.h
index 588c97da..9d12ed14 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -20,7 +20,7 @@
#ifndef __SYS_SELECT_H
#define __SYS_SELECT_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 1fc79a11..da174d27 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -21,7 +21,7 @@
#ifndef __SYS_SOCKET_H
#define __SYS_SOCKET_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/uio.h>
diff --git a/include/sys/stdio.h b/include/sys/stdio.h
index c9b0a5c7..dee114a5 100644
--- a/include/sys/stdio.h
+++ b/include/sys/stdio.h
@@ -8,7 +8,7 @@
#ifndef _NEWLIB_STDIO_H
#define _NEWLIB_STDIO_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
// Cribbed from newlib sys/stdio.h
diff --git a/include/sys/uio.h b/include/sys/uio.h
index e7d23a94..5362c99e 100644
--- a/include/sys/uio.h
+++ b/include/sys/uio.h
@@ -19,7 +19,7 @@
#ifndef __SYS_UIO_H
#define __SYS_UIO_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
diff --git a/include/sys/utsname.h b/include/sys/utsname.h
index 72864993..dbeb4cdc 100644
--- a/include/sys/utsname.h
+++ b/include/sys/utsname.h
@@ -19,7 +19,7 @@
#ifndef __SYS_UTSNAME_H
#define __SYS_UTSNAME_H
-#include <kos/cdefs.h>
+#include <sys/cdefs.h>
__BEGIN_DECLS
diff --git a/kernel/thread/Makefile b/kernel/thread/Makefile
index 51966bd5..f1fa5a65 100644
--- a/kernel/thread/Makefile
+++ b/kernel/thread/Makefile
@@ -9,7 +9,12 @@ OBJS += thread.o rwsem.o once.o tls.o barrier.o
OBJS += oneshot_timer.o worker.o
SUBDIRS =
-include $(KOS_BASE)/Makefile.prefab
-
+# On toolchains that support the C23 standard (aka. GCC > 14), compile-test
+# our gthr-kos.h against the regular KOS includes, to make sure that the
+# toolchain file does not lag behind.
+OBJS += $(intcmp $(firstword $(subst ., ,${KOS_GCCVER})),14,,,toolchain_test.o)
+include $(KOS_BASE)/Makefile.prefab
+toolchain_test.o: ${KOS_BASE}/utils/dc-chain/patches/gcc/gthr-kos.h
+ kos-cc -DTEST_GTHR_KOS_API -std=c23 -c $< -o $@
diff --git a/utils/dc-chain/patches/gcc/gthr-kos.h b/utils/dc-chain/patches/gcc/gthr-kos.h
index e71cb923..8a383ac1 100644
--- a/utils/dc-chain/patches/gcc/gthr-kos.h
+++ b/utils/dc-chain/patches/gcc/gthr-kos.h
@@ -31,22 +31,76 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef GCC_GTHR_KOS_H
#define GCC_GTHR_KOS_H
+#include <sys/cdefs.h>
+__BEGIN_DECLS
+
/* KallistiOS threads specific definitions. */
#define __GTHREADS 1
#define __GTHREADS_CXX0X 1
#define __GTHREAD_HAS_COND 1
+#ifdef TEST_GTHR_KOS_API
#include <kos/thread.h>
#include <kos/tls.h>
#include <kos/mutex.h>
#include <kos/once.h>
#include <kos/cond.h>
#include <arch/irq.h>
-#include <time.h>
+#endif
/* 9.5.0 somehow requires this. Remove when no longer supported */
#include <pthread.h>
+#include <stdbool.h>
+#include <time.h>
+
+/* KOS types */
+struct kthread;
+
+typedef struct kthread kthread_t;
+
+typedef int kthread_key_t;
+typedef volatile int kthread_once_t;
+
+/* mutex_t / condvar_t need to be defined explicitly as we need to be able to
+ * sizeof() them */
+typedef struct kos_mutex {
+ unsigned int type;
+ kthread_t *holder;
+ int count;
+} mutex_t;
+
+typedef struct condvar {
+ int dummy;
+} condvar_t;
+
+kthread_t *thd_create(bool detach, void *(*routine)(void *param), void *param);
+void thd_pass(void);
+void thd_exit(void *rv) __noreturn;
+int thd_join(kthread_t *thd, void **value_ptr);
+int thd_detach(kthread_t *thd);
+kthread_t *thd_get_current(void);
+int kthread_setspecific(int key, const void *value);
+void *kthread_getspecific(int key);
+
+int kthread_once(volatile int *once_control, void (*init_routine)(void));
+int kthread_key_create(int *key, void (*destructor)(void *));
+int kthread_key_delete(int key);
+
+int mutex_init(mutex_t *m, unsigned int mtype) __nonnull_all;
+int __pure mutex_is_locked(const mutex_t *m) __nonnull_all;
+int mutex_lock(mutex_t *m) __nonnull_all;
+int mutex_trylock(mutex_t *m) __nonnull_all;
+int mutex_lock_timed(mutex_t *m, int timeout) __nonnull_all;
+int mutex_unlock(mutex_t *m) __nonnull_all;
+int mutex_destroy(mutex_t *m) __nonnull_all;
+
+int cond_init(condvar_t *cv) __nonnull_all;
+int cond_destroy(condvar_t *cv) __nonnull_all;
+int cond_wait(condvar_t *cv, mutex_t * m) __nonnull_all;
+int cond_wait_timed(condvar_t *cv, mutex_t *m, int timeout) __nonnull_all;
+int cond_broadcast(condvar_t *cv) __nonnull_all;
+int cond_signal(condvar_t *cv) __nonnull_all;
/* These should work just fine. */
typedef kthread_key_t __gthread_key_t;
@@ -57,6 +111,15 @@ typedef condvar_t __gthread_cond_t;
typedef kthread_t *__gthread_t;
typedef struct timespec __gthread_time_t;
+#define KTHREAD_ONCE_INIT 0
+
+#define MUTEX_TYPE_NORMAL 0
+#define MUTEX_TYPE_RECURSIVE 3
+
+#define MUTEX_INITIALIZER { MUTEX_TYPE_NORMAL, NULL, 0 }
+#define RECURSIVE_MUTEX_INITIALIZER { MUTEX_TYPE_RECURSIVE, NULL, 0 }
+#define COND_INITIALIZER { 0 }
+
#define __GTHREAD_ONCE_INIT KTHREAD_ONCE_INIT
#define __GTHREAD_MUTEX_INIT MUTEX_INITIALIZER
#define __GTHREAD_RECURSIVE_MUTEX_INIT RECURSIVE_MUTEX_INITIALIZER
@@ -176,19 +239,14 @@ static inline int __gthread_objc_mutex_allocate(objc_mutex_t mutex) {
/* Deallocate a mutex. */
static inline int __gthread_objc_mutex_deallocate(objc_mutex_t mutex) {
mutex_t *m = (mutex_t *)mutex->backend;
- uint32 old;
- old = irq_disable();
-
- while(mutex_is_locked(m)) {
+ if(mutex_is_locked(m))
mutex_unlock(m);
- }
if(mutex_destroy(m))
return -1;
mutex->backend = NULL;
- irq_restore(old);
objc_free(m);
@@ -403,5 +461,6 @@ static inline int __gthread_cond_destroy(__gthread_cond_t *cond) {
#endif /* !_LIBOBJC */
+__END_DECLS
#endif /* ! GCC_GTHR_KOS_H */
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-24 02:21:13
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via b0a78dfd2bdad675028b687ba8b7f691d503a15f (commit)
from 79034390f3a298b9b90c73a09c8f74a4a6d28fd3 (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 b0a78dfd2bdad675028b687ba8b7f691d503a15f
Author: Paul Cercueil <pa...@cr...>
Date: Sat Aug 23 20:09:12 2025 +0200
cmake: Restore compatibility with CMake 3.20
Since the long-term supported Ubuntu 24.04 ships with CMake 3.20, we
should make sure that we keep compatibility with that.
The 'EXPAND_TILDE' option of the file() function was added in CMake
3.21, so we should not use it. This should be okay as the paths found in
the various KOS environment variables should already be absolute and not
relative to the home directory.
Fixes #1159.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
utils/cmake/kallistios.toolchain.cmake | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/utils/cmake/kallistios.toolchain.cmake b/utils/cmake/kallistios.toolchain.cmake
index b7e008c0..35c976e0 100644
--- a/utils/cmake/kallistios.toolchain.cmake
+++ b/utils/cmake/kallistios.toolchain.cmake
@@ -36,10 +36,10 @@ if(NOT DEFINED ENV{KOS_BASE}
message(FATAL_ERROR "KallistiOS environment variables not found")
endif()
-file(REAL_PATH $ENV{KOS_BASE} KOS_BASE EXPAND_TILDE)
-file(REAL_PATH $ENV{KOS_CC_BASE} KOS_CC_BASE EXPAND_TILDE)
-file(REAL_PATH $ENV{KOS_PORTS} KOS_PORTS EXPAND_TILDE)
-file(REAL_PATH $ENV{DC_TOOLS_BASE} DC_TOOLS_BASE EXPAND_TILDE)
+file(REAL_PATH $ENV{KOS_BASE} KOS_BASE)
+file(REAL_PATH $ENV{KOS_CC_BASE} KOS_CC_BASE)
+file(REAL_PATH $ENV{KOS_PORTS} KOS_PORTS)
+file(REAL_PATH $ENV{DC_TOOLS_BASE} DC_TOOLS_BASE)
set(KOS_ARCH $ENV{KOS_ARCH})
set(KOS_SUBARCH $ENV{KOS_SUBARCH})
set(KOS_ADDONS ${KOS_BASE}/addons)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-19 01:55: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 79034390f3a298b9b90c73a09c8f74a4a6d28fd3 (commit)
from 011c420e0b5c843591fb8258c4784eab4459fdac (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 79034390f3a298b9b90c73a09c8f74a4a6d28fd3
Author: Paul Cercueil <pa...@cr...>
Date: Tue Aug 19 01:30:25 2025 +0200
treewide: Update all files to include <kos/cdefs.h>
Plenty of files would use macros defined within <kos/cdefs.h>, but would
include <sys/cdefs.h>. Those would only compile because they would also
include <arch/types.h>, includes <arch/_types.h> that itself includes
<kos/cdefs.h>.
This gets nastier, when taking into consideration that the
<arch/_types.h> include is only done if the BYTE_ORDER macro is unset.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
include/arpa/inet.h | 2 +-
include/kos/barrier.h | 2 +-
include/kos/blockdev.h | 2 +-
include/kos/elf.h | 2 +-
include/kos/exports.h | 2 +-
include/kos/fs.h | 2 +-
include/kos/fs_dev.h | 2 +-
include/kos/fs_null.h | 2 +-
include/kos/fs_pty.h | 2 +-
include/kos/fs_ramdisk.h | 2 +-
include/kos/fs_random.h | 2 +-
include/kos/fs_romdisk.h | 2 +-
include/kos/fs_socket.h | 2 +-
include/kos/genwait.h | 2 +-
include/kos/library.h | 2 +-
include/kos/net.h | 2 +-
include/kos/nmmgr.h | 2 +-
include/kos/once.h | 2 +-
include/kos/oneshot_timer.h | 2 +-
include/kos/opts.h | 2 +-
include/kos/regfield.h | 2 +-
include/kos/string.h | 2 +-
include/kos/thread.h | 2 +-
include/kos/tls.h | 2 +-
include/kos/worker_thread.h | 2 +-
include/libgen.h | 2 +-
include/malloc.h | 2 +-
include/netdb.h | 2 +-
include/netinet/in.h | 2 +-
include/netinet/tcp.h | 2 +-
include/netinet/udp.h | 2 +-
include/netinet/udplite.h | 2 +-
include/poll.h | 2 +-
include/pthread.h | 2 +-
include/sys/_pthreadtypes.h | 2 +-
include/sys/ioctl.h | 2 +-
include/sys/lock.h | 2 +-
include/sys/sched.h | 2 +-
include/sys/select.h | 2 +-
include/sys/socket.h | 2 +-
include/sys/stdio.h | 2 +-
include/sys/uio.h | 2 +-
include/sys/utsname.h | 2 +-
include/threads.h | 2 +-
kernel/arch/dreamcast/hardware/pvr/pvr_mem_core.h | 2 +-
kernel/arch/dreamcast/include/arch/byteorder.h | 2 +-
kernel/arch/dreamcast/include/arch/cache.h | 2 +-
kernel/arch/dreamcast/include/arch/dmac.h | 2 +-
kernel/arch/dreamcast/include/arch/exec.h | 2 +-
kernel/arch/dreamcast/include/arch/gdb.h | 2 +-
kernel/arch/dreamcast/include/arch/irq.h | 2 +-
kernel/arch/dreamcast/include/arch/memory.h | 2 +-
kernel/arch/dreamcast/include/arch/mmu.h | 2 +-
kernel/arch/dreamcast/include/arch/rtc.h | 2 +-
kernel/arch/dreamcast/include/arch/spinlock.h | 2 +-
kernel/arch/dreamcast/include/arch/stack.h | 2 +-
kernel/arch/dreamcast/include/arch/timer.h | 2 +-
kernel/arch/dreamcast/include/arch/tls_static.h | 2 +-
kernel/arch/dreamcast/include/arch/trap.h | 2 +-
kernel/arch/dreamcast/include/arch/types.h | 2 +-
kernel/arch/dreamcast/include/arch/wdt.h | 2 +-
kernel/arch/dreamcast/include/dc/asic.h | 2 +-
kernel/arch/dreamcast/include/dc/cdrom.h | 2 +-
kernel/arch/dreamcast/include/dc/fb_console.h | 2 +-
kernel/arch/dreamcast/include/dc/fifo.h | 2 +-
kernel/arch/dreamcast/include/dc/flashrom.h | 2 +-
kernel/arch/dreamcast/include/dc/fmath.h | 2 +-
kernel/arch/dreamcast/include/dc/fmath_base.h | 2 +-
kernel/arch/dreamcast/include/dc/fs_dcload.h | 2 +-
kernel/arch/dreamcast/include/dc/fs_dclsocket.h | 2 +-
kernel/arch/dreamcast/include/dc/fs_iso9660.h | 2 +-
kernel/arch/dreamcast/include/dc/fs_vmu.h | 2 +-
kernel/arch/dreamcast/include/dc/g1ata.h | 2 +-
kernel/arch/dreamcast/include/dc/g2bus.h | 2 +-
kernel/arch/dreamcast/include/dc/maple.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/controller.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/dreameye.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/keyboard.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/lightgun.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/mouse.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/purupuru.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/sip.h | 2 +-
kernel/arch/dreamcast/include/dc/maple/vmu.h | 2 +-
kernel/arch/dreamcast/include/dc/math.h | 2 +-
kernel/arch/dreamcast/include/dc/matrix.h | 2 +-
kernel/arch/dreamcast/include/dc/matrix3d.h | 2 +-
kernel/arch/dreamcast/include/dc/net/broadband_adapter.h | 2 +-
kernel/arch/dreamcast/include/dc/net/lan_adapter.h | 2 +-
kernel/arch/dreamcast/include/dc/perf_monitor.h | 2 +-
kernel/arch/dreamcast/include/dc/perfctr.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_dma.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_fog.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_header.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_mem.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_misc.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_pal.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_regs.h | 2 +-
kernel/arch/dreamcast/include/dc/pvr/pvr_txr.h | 2 +-
kernel/arch/dreamcast/include/dc/sci.h | 2 +-
kernel/arch/dreamcast/include/dc/scif.h | 2 +-
kernel/arch/dreamcast/include/dc/sd.h | 2 +-
kernel/arch/dreamcast/include/dc/sound/sfxmgr.h | 2 +-
kernel/arch/dreamcast/include/dc/sound/sound.h | 2 +-
kernel/arch/dreamcast/include/dc/sound/stream.h | 2 +-
kernel/arch/dreamcast/include/dc/spu.h | 2 +-
kernel/arch/dreamcast/include/dc/sq.h | 2 +-
kernel/arch/dreamcast/include/dc/syscalls.h | 2 +-
kernel/arch/dreamcast/include/dc/vblank.h | 2 +-
kernel/arch/dreamcast/include/dc/vec3f.h | 2 +-
kernel/arch/dreamcast/include/dc/vector.h | 2 +-
kernel/arch/dreamcast/include/dc/video.h | 2 +-
kernel/arch/dreamcast/include/dc/vmu_fb.h | 2 +-
kernel/arch/dreamcast/include/dc/vmu_pkg.h | 2 +-
kernel/arch/dreamcast/include/dc/vmufs.h | 2 +-
kernel/net/net_dhcp.h | 2 +-
kernel/net/net_icmp.h | 2 +-
kernel/net/net_thd.h | 2 +-
118 files changed, 118 insertions(+), 118 deletions(-)
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index 54b48216..7653b2ad 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -18,7 +18,7 @@
#ifndef __ARPA_INET_H
#define __ARPA_INET_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
diff --git a/include/kos/barrier.h b/include/kos/barrier.h
index 3f7d221f..47db2300 100644
--- a/include/kos/barrier.h
+++ b/include/kos/barrier.h
@@ -7,7 +7,7 @@
#ifndef __KOS_BARRIER_H
#define __KOS_BARRIER_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
/** \file kos/barrier.h
diff --git a/include/kos/blockdev.h b/include/kos/blockdev.h
index ecf8dc93..2114354d 100644
--- a/include/kos/blockdev.h
+++ b/include/kos/blockdev.h
@@ -25,7 +25,7 @@
#ifndef __KOS_BLOCKDEV_H
#define __KOS_BLOCKDEV_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <stdint.h>
diff --git a/include/kos/elf.h b/include/kos/elf.h
index 43b0499a..05ca28b8 100644
--- a/include/kos/elf.h
+++ b/include/kos/elf.h
@@ -21,7 +21,7 @@
#ifndef __KOS_ELF_H
#define __KOS_ELF_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <stdint.h>
diff --git a/include/kos/exports.h b/include/kos/exports.h
index da30f13e..ffdb1c50 100644
--- a/include/kos/exports.h
+++ b/include/kos/exports.h
@@ -21,7 +21,7 @@
#ifndef __KOS_EXPORTS_H
#define __KOS_EXPORTS_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <stdint.h>
diff --git a/include/kos/fs.h b/include/kos/fs.h
index e6a75756..f140861b 100644
--- a/include/kos/fs.h
+++ b/include/kos/fs.h
@@ -24,7 +24,7 @@
#ifndef __KOS_FS_H
#define __KOS_FS_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <sys/types.h>
diff --git a/include/kos/fs_dev.h b/include/kos/fs_dev.h
index ca3922f7..b8003be9 100644
--- a/include/kos/fs_dev.h
+++ b/include/kos/fs_dev.h
@@ -19,7 +19,7 @@
#ifndef __DC_FS_DEV_H
#define __DC_FS_DEV_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/fs.h>
diff --git a/include/kos/fs_null.h b/include/kos/fs_null.h
index a0f3994b..55f87607 100644
--- a/include/kos/fs_null.h
+++ b/include/kos/fs_null.h
@@ -18,7 +18,7 @@
#ifndef __DC_FS_NULL_H
#define __DC_FS_NULL_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/fs.h>
diff --git a/include/kos/fs_pty.h b/include/kos/fs_pty.h
index d0626547..1452b83e 100644
--- a/include/kos/fs_pty.h
+++ b/include/kos/fs_pty.h
@@ -23,7 +23,7 @@
#ifndef __KOS_FS_PTY_H
#define __KOS_FS_PTY_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/fs.h>
diff --git a/include/kos/fs_ramdisk.h b/include/kos/fs_ramdisk.h
index d47a2c22..9f79833b 100644
--- a/include/kos/fs_ramdisk.h
+++ b/include/kos/fs_ramdisk.h
@@ -23,7 +23,7 @@
#ifndef __KOS_FS_RAMDISK_H
#define __KOS_FS_RAMDISK_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/fs.h>
diff --git a/include/kos/fs_random.h b/include/kos/fs_random.h
index e04856ae..78346203 100644
--- a/include/kos/fs_random.h
+++ b/include/kos/fs_random.h
@@ -25,7 +25,7 @@
#ifndef __DC_FS_RANDOM_H
#define __DC_FS_RANDOM_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/fs.h>
diff --git a/include/kos/fs_romdisk.h b/include/kos/fs_romdisk.h
index 3eb2d952..e37bda39 100644
--- a/include/kos/fs_romdisk.h
+++ b/include/kos/fs_romdisk.h
@@ -49,7 +49,7 @@
#ifndef __KOS_FS_ROMDISK_H
#define __KOS_FS_ROMDISK_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
#include <stdbool.h>
#include <stdint.h>
__BEGIN_DECLS
diff --git a/include/kos/fs_socket.h b/include/kos/fs_socket.h
index dc984a38..d361dcc4 100644
--- a/include/kos/fs_socket.h
+++ b/include/kos/fs_socket.h
@@ -25,7 +25,7 @@
#ifndef __KOS_FS_SOCKET_H
#define __KOS_FS_SOCKET_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
diff --git a/include/kos/genwait.h b/include/kos/genwait.h
index 0f480a73..c538fea6 100644
--- a/include/kos/genwait.h
+++ b/include/kos/genwait.h
@@ -23,7 +23,7 @@
#ifndef __KOS_GENWAIT_H
#define __KOS_GENWAIT_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/thread.h>
diff --git a/include/kos/library.h b/include/kos/library.h
index f7dbf50b..da0d718c 100644
--- a/include/kos/library.h
+++ b/include/kos/library.h
@@ -28,7 +28,7 @@
#ifndef __KOS_LIBRARY_H
#define __KOS_LIBRARY_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/thread.h>
diff --git a/include/kos/net.h b/include/kos/net.h
index 19b74a9b..e3af36f3 100644
--- a/include/kos/net.h
+++ b/include/kos/net.h
@@ -20,7 +20,7 @@
#ifndef __KOS_NET_H
#define __KOS_NET_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
#include <stdint.h>
__BEGIN_DECLS
diff --git a/include/kos/nmmgr.h b/include/kos/nmmgr.h
index 1d11ae5a..f2213569 100644
--- a/include/kos/nmmgr.h
+++ b/include/kos/nmmgr.h
@@ -19,7 +19,7 @@
#ifndef __KOS_NMMGR_H
#define __KOS_NMMGR_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <stdint.h>
diff --git a/include/kos/once.h b/include/kos/once.h
index a0f25853..b8df0819 100644
--- a/include/kos/once.h
+++ b/include/kos/once.h
@@ -21,7 +21,7 @@
\author Lawrence Sebald
*/
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
diff --git a/include/kos/oneshot_timer.h b/include/kos/oneshot_timer.h
index 40c27048..76fb6dc6 100644
--- a/include/kos/oneshot_timer.h
+++ b/include/kos/oneshot_timer.h
@@ -21,7 +21,7 @@
#ifndef __KOS_ONESHOT_TIMER_H
#define __KOS_ONESHOT_TIMER_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
struct oneshot_timer;
diff --git a/include/kos/opts.h b/include/kos/opts.h
index 069d9c65..b4bb72eb 100644
--- a/include/kos/opts.h
+++ b/include/kos/opts.h
@@ -29,7 +29,7 @@
#ifndef __KOS_OPTS_H
#define __KOS_OPTS_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
/** \defgroup debugging_options Options
diff --git a/include/kos/regfield.h b/include/kos/regfield.h
index f3e66ed3..9bfad265 100644
--- a/include/kos/regfield.h
+++ b/include/kos/regfield.h
@@ -16,7 +16,7 @@
#ifndef __KOS_REGFIELD_H
#define __KOS_REGFIELD_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
/** \brief Create a mask with a bit set
diff --git a/include/kos/string.h b/include/kos/string.h
index 855a565d..b3a67f01 100644
--- a/include/kos/string.h
+++ b/include/kos/string.h
@@ -29,7 +29,7 @@
#ifndef __KOS_STRING_H
#define __KOS_STRING_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <string.h>
diff --git a/include/kos/thread.h b/include/kos/thread.h
index add2b361..23d91f13 100644
--- a/include/kos/thread.h
+++ b/include/kos/thread.h
@@ -35,7 +35,7 @@
#ifndef __KOS_THREAD_H
#define __KOS_THREAD_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/cdefs.h>
diff --git a/include/kos/tls.h b/include/kos/tls.h
index 1e67bb9d..9da834a7 100644
--- a/include/kos/tls.h
+++ b/include/kos/tls.h
@@ -18,7 +18,7 @@
#ifndef __KOS_TLS_H
#define __KOS_TLS_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
diff --git a/include/kos/worker_thread.h b/include/kos/worker_thread.h
index 0d291897..7fb3c253 100644
--- a/include/kos/worker_thread.h
+++ b/include/kos/worker_thread.h
@@ -29,7 +29,7 @@
#ifndef __KOS_WORKER_THREAD_H
#define __KOS_WORKER_THREAD_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
#include <kos/thread.h>
diff --git a/include/libgen.h b/include/libgen.h
index dc3a3bed..1245ae6a 100644
--- a/include/libgen.h
+++ b/include/libgen.h
@@ -23,7 +23,7 @@
#ifndef __LIBGEN_H
#define __LIBGEN_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
/** \addtogroup vfs_posix
diff --git a/include/malloc.h b/include/malloc.h
index daaab448..e691537e 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -19,7 +19,7 @@
#ifndef __MALLOC_H
#define __MALLOC_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
/** \defgroup system_allocator Allocator
diff --git a/include/netdb.h b/include/netdb.h
index fbd9a382..4343856d 100644
--- a/include/netdb.h
+++ b/include/netdb.h
@@ -18,7 +18,7 @@
#ifndef __NETDB_H
#define __NETDB_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 5fb23321..95aacb7f 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -20,7 +20,7 @@
#ifndef __NETINET_IN_H
#define __NETINET_IN_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h
index bc0a8c01..dcdd9c4a 100644
--- a/include/netinet/tcp.h
+++ b/include/netinet/tcp.h
@@ -21,7 +21,7 @@
#ifndef __NETINET_TCP_H
#define __NETINET_TCP_H
-#include <sys/cdefs.h>
+#include <kos/cdefs.h>
__BEGIN_DECLS
diff --git a/include/netinet/udp.h b/include/netinet/udp.h
index 85d9fc85..ea92da95 100644
...<truncated>...
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-16 17:02: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 011c420e0b5c843591fb8258c4784eab4459fdac (commit)
via 4e79be987997f5e1250da90d0cf89b443da3d439 (commit)
from a6cf282777a0aa3477f725695c38eb072f97e599 (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 011c420e0b5c843591fb8258c4784eab4459fdac
Author: darc <da...@pr...>
Date: Wed Aug 6 10:22:31 2025 -0500
Add arch_stk_setup function for setting up a new stack during thread creation
Some architectures, like PowerPC, need the stack to be adjusted before thread creation.
This is unnecessary on Dreamcast, so the implementation added to Dreamcast is empty.
commit 4e79be987997f5e1250da90d0cf89b443da3d439
Author: darc <da...@pr...>
Date: Wed Aug 6 10:10:44 2025 -0500
Move stack functions from arch.h to stack.h
-----------------------------------------------------------------------
Summary of changes:
addons/libpthread/pthread_attr_init.c | 2 +-
.../basic/stackprotector/stackprotector.c | 2 +-
kernel/arch/dreamcast/hardware/pvr/pvr_mem.c | 2 +
kernel/arch/dreamcast/include/arch/arch.h | 71 +-----------------
kernel/arch/dreamcast/include/arch/stack.h | 87 ++++++++++++++++++++--
kernel/arch/dreamcast/kernel/mm.c | 4 +-
kernel/arch/dreamcast/kernel/stack.c | 10 ++-
kernel/thread/thread.c | 17 ++++-
8 files changed, 109 insertions(+), 86 deletions(-)
diff --git a/addons/libpthread/pthread_attr_init.c b/addons/libpthread/pthread_attr_init.c
index 6eab4ace..43732e16 100644
--- a/addons/libpthread/pthread_attr_init.c
+++ b/addons/libpthread/pthread_attr_init.c
@@ -11,7 +11,7 @@
#include <string.h>
#include <kos/thread.h>
-#include <arch/arch.h>
+#include <arch/stack.h>
int pthread_attr_init(pthread_attr_t *attr) {
if(!attr)
diff --git a/examples/dreamcast/basic/stackprotector/stackprotector.c b/examples/dreamcast/basic/stackprotector/stackprotector.c
index 235840fc..710360f1 100644
--- a/examples/dreamcast/basic/stackprotector/stackprotector.c
+++ b/examples/dreamcast/basic/stackprotector/stackprotector.c
@@ -26,7 +26,7 @@
#include <string.h>
#include <stdio.h>
-#include <arch/arch.h>
+#include <arch/stack.h>
#include <stdlib.h>
/* This function will override the default stack protector handler that is
diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_mem.c b/kernel/arch/dreamcast/hardware/pvr/pvr_mem.c
index b9cff2bf..fc6ac904 100644
--- a/kernel/arch/dreamcast/hardware/pvr/pvr_mem.c
+++ b/kernel/arch/dreamcast/hardware/pvr/pvr_mem.c
@@ -15,6 +15,8 @@
#include <kos/opts.h>
#include <kos/dbglog.h>
+#include <arch/stack.h>
+
/*
This module basically serves as a KOS-friendly front end and support routines
diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h
index 1f9d227c..2414f919 100644
--- a/kernel/arch/dreamcast/include/arch/arch.h
+++ b/kernel/arch/dreamcast/include/arch/arch.h
@@ -10,8 +10,7 @@
\brief Dreamcast architecture specific options.
\ingroup arch
- This file has various architecture specific options defined in it. Also, any
- functions that start with arch_ are in here.
+ This file has various architecture specific options defined in it.
\author Megan Potter
*/
@@ -80,21 +79,6 @@ extern char _etext;
static const
unsigned HZ __depr("Please use the new THD_SCHED_HZ macro.") = THD_SCHED_HZ;
-#ifndef THD_STACK_ALIGNMENT
-/** \brief Required alignment for stack. */
-#define THD_STACK_ALIGNMENT 8
-#endif
-
-#ifndef THD_STACK_SIZE
-/** \brief Default thread stack size. */
-#define THD_STACK_SIZE 32768
-#endif
-
-#ifndef THD_KERNEL_STACK_SIZE
-/** \brief Main/kernel thread's stack size. */
-#define THD_KERNEL_STACK_SIZE (64 * 1024)
-#endif
-
/** \brief Default video mode. */
#define DEFAULT_VID_MODE DM_640x480
@@ -376,59 +360,6 @@ static inline void arch_sleep(void) {
__asm__ __volatile__("sleep\n");
}
-/** \brief DC specific "function" to get the return address from the current
- function.
- \ingroup arch
-
- \return The return address of the current function.
-*/
-static __always_inline uintptr_t arch_get_ret_addr(void) {
- uintptr_t pr;
-
- __asm__ __volatile__("sts pr,%0\n" : "=r"(pr));
-
- return pr;
-}
-
-/* Please note that all of the following frame pointer macros are ONLY
- valid if you have compiled your code WITHOUT -fomit-frame-pointer. These
- are mainly useful for getting a stack trace from an error. */
-
-/** \brief DC specific "function" to get the frame pointer from the current
- function.
- \ingroup arch
-
- \return The frame pointer from the current function.
- \note This only works if you don't disable frame pointers.
-*/
-static __always_inline uintptr_t arch_get_fptr(void) {
- register uintptr_t fp __asm__("r14");
-
- return fp;
-}
-
-/** \brief Pass in a frame pointer value to get the return address for the
- given frame.
- \ingroup arch
-
- \param fptr The frame pointer to look at.
- \return The return address of the pointer.
-*/
-static inline uintptr_t arch_fptr_ret_addr(uintptr_t fptr) {
- return *(uintptr_t *)fptr;
-}
-
-/** \brief Pass in a frame pointer value to get the previous frame pointer for
- the given frame.
- \ingroup arch
-
- \param fptr The frame pointer to look at.
- \return The previous frame pointer.
-*/
-static inline uintptr_t arch_fptr_next(uintptr_t fptr) {
- return arch_fptr_ret_addr(fptr + 4);
-}
-
/** \brief Returns true if the passed address is likely to be valid. Doesn't
have to be exact, just a sort of general idea.
\ingroup arch
diff --git a/kernel/arch/dreamcast/include/arch/stack.h b/kernel/arch/dreamcast/include/arch/stack.h
index d587aa25..6612bf4f 100644
--- a/kernel/arch/dreamcast/include/arch/stack.h
+++ b/kernel/arch/dreamcast/include/arch/stack.h
@@ -2,19 +2,22 @@
arch/dreamcast/include/arch/stack.h
(c)2002 Megan Potter
+ (c)2025 Eric Fradella
*/
/** \file arch/stack.h
- \brief Stack tracing.
+ \brief Stack functions
\ingroup debugging_stacktrace
- The functions in this file deal with doing stack traces. These functions
- will do a stack trace, as specified, printing it out to stdout (usually a
- dcload terminal). These functions only work if frame pointers have been
- enabled at compile time (-DFRAME_POINTERS and no -fomit-frame-pointer flag).
+ This file contains arch-specific stack implementations, including defining
+ stack sizes and alignments, as well as functions for stack tracing and
+ debugging. On Dreamcast, the stack tracing functions only work if frame
+ pointers have been enabled at compile time (-DFRAME_POINTERS and no
+ -fomit-frame-pointer flag).
\author Megan Potter
+ \author Eric Fradella
*/
#ifndef __ARCH_STACK_H
@@ -24,6 +27,7 @@
__BEGIN_DECLS
#include <stdint.h>
+#include <kos/thread.h>
/** \defgroup debugging_stacktrace Stack Traces
\brief API for managing stack backtracing
@@ -32,6 +36,79 @@ __BEGIN_DECLS
@{
*/
+#ifndef THD_STACK_ALIGNMENT
+/** \brief Required alignment for stack. */
+#define THD_STACK_ALIGNMENT 8
+#endif
+
+#ifndef THD_STACK_SIZE
+/** \brief Default thread stack size. */
+#define THD_STACK_SIZE 32768
+#endif
+
+#ifndef THD_KERNEL_STACK_SIZE
+/** \brief Main/kernel thread's stack size. */
+#define THD_KERNEL_STACK_SIZE (64 * 1024)
+#endif
+
+/** \brief DC specific "function" to get the return address from the current
+ function.
+
+ \return The return address of the current function.
+*/
+static __always_inline uintptr_t arch_get_ret_addr(void) {
+ uintptr_t pr;
+
+ __asm__ __volatile__("sts pr,%0\n" : "=r"(pr));
+
+ return pr;
+}
+
+/* Please note that all of the following frame pointer macros are ONLY
+ valid if you have compiled your code WITHOUT -fomit-frame-pointer. These
+ are mainly useful for getting a stack trace from an error. */
+
+/** \brief DC specific "function" to get the frame pointer from the current
+ function.
+
+ \return The frame pointer from the current function.
+ \note This only works if you don't disable frame pointers.
+*/
+static __always_inline uintptr_t arch_get_fptr(void) {
+ register uintptr_t fp __asm__("r14");
+
+ return fp;
+}
+
+/** \brief Pass in a frame pointer value to get the return address for the
+ given frame.
+
+ \param fptr The frame pointer to look at.
+ \return The return address of the pointer.
+*/
+static inline uintptr_t arch_fptr_ret_addr(uintptr_t fptr) {
+ return *(uintptr_t *)fptr;
+}
+
+/** \brief Pass in a frame pointer value to get the previous frame pointer for
+ the given frame.
+
+ \param fptr The frame pointer to look at.
+ \return The previous frame pointer.
+*/
+static inline uintptr_t arch_fptr_next(uintptr_t fptr) {
+ return arch_fptr_ret_addr(fptr + 4);
+}
+
+/** \brief Set up new stack before running.
+
+ This function does nothing as it is unnecessary on Dreamcast.
+
+ \param nt A pointer to the new thread for which a stack
+ is to be set up.
+*/
+void arch_stk_setup(kthread_t *nt);
+
/** \brief Do a stack trace from the current function.
This function does a stack trace from the current function, printing the
diff --git a/kernel/arch/dreamcast/kernel/mm.c b/kernel/arch/dreamcast/kernel/mm.c
index 37641fe0..03cfe32c 100644
--- a/kernel/arch/dreamcast/kernel/mm.c
+++ b/kernel/arch/dreamcast/kernel/mm.c
@@ -13,10 +13,10 @@
/* Note: right now we only support system RAM */
-
-#include <arch/types.h>
#include <arch/arch.h>
+#include <arch/types.h>
#include <arch/irq.h>
+#include <arch/stack.h>
#include <kos/dbglog.h>
#include <errno.h>
#include <stdio.h>
diff --git a/kernel/arch/dreamcast/kernel/stack.c b/kernel/arch/dreamcast/kernel/stack.c
index 31dffb16..32404b92 100644
--- a/kernel/arch/dreamcast/kernel/stack.c
+++ b/kernel/arch/dreamcast/kernel/stack.c
@@ -7,10 +7,7 @@
/* Functions to tinker with the stack, including obtaining a stack
trace when frame pointers are enabled. If frame pointers are enabled,
then you'll need to also define FRAME_POINTERS to get support for stack
- traces.
-
- We could probably technically move this into arch indep with a bit more
- work... */
+ traces. */
#include <kos/dbgio.h>
#include <arch/arch.h>
@@ -23,6 +20,11 @@ static uintptr_t arch_stack_32m_dft = 0x8e000000;
extern uintptr_t arch_stack_16m __attribute__((weak,alias("arch_stack_16m_dft")));
extern uintptr_t arch_stack_32m __attribute__((weak,alias("arch_stack_32m_dft")));
+/* This function is unnecessary and does nothing on Dreamcast */
+void arch_stk_setup(kthread_t *nt) {
+ (void)nt;
+}
+
/* Do a stack trace from the current function; leave off the first n frames
(i.e., in assert()). */
__noinline void arch_stk_trace(int n) {
diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c
index 36e57aa1..66d9a5af 100644
--- a/kernel/thread/thread.c
+++ b/kernel/thread/thread.c
@@ -26,9 +26,10 @@
#include <kos/cond.h>
#include <kos/genwait.h>
+#include <arch/arch.h>
#include <arch/irq.h>
+#include <arch/stack.h>
#include <arch/timer.h>
-#include <arch/arch.h>
#include <arch/tls_static.h>
/*
@@ -361,8 +362,11 @@ int thd_remove_from_runnable(kthread_t *thd) {
}
/* New thread function; given a routine address, it will create a
- new kernel thread with the given attributes. When the routine
- returns, the thread will exit. Returns the new thread struct. */
+ new thread with the given attributes. When the routine returns,
+ the thread will exit. Returns the new thread struct.
+ Note that this function is also used in thd_init() to add the
+ already running kernel thread to the thread scheduler. This is
+ the only circumstance in which routine should be NULL. */
kthread_t *thd_create_ex(const kthread_attr_t *restrict attr,
void *(*routine)(void *param), void *param) {
kthread_t *nt = NULL;
@@ -430,6 +434,13 @@ kthread_t *thd_create_ex(const kthread_attr_t *restrict attr,
((uint32_t)nt->stack) + nt->stack_size,
(uint32_t)thd_birth, params, 0);
+ /* Some architectures require setting up a new stack before use.
+ We won't do this if routine is NULL, however, as this means
+ we are creating the kernel thread, which is already running. */
+ if(routine) {
+ arch_stk_setup(nt);
+ }
+
/* Create static TLS data if the thread hasn't disabled it. */
if(real_attr.disable_tls) {
nt->flags |= THD_DISABLE_TLS;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-16 05:16:51
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via a6cf282777a0aa3477f725695c38eb072f97e599 (commit)
via 2df8eac788c9eb90779171feca7e8ba28e0f965c (commit)
via 2ea09fd2eb5ac0ddea0f1998bbe62d7b25b6a561 (commit)
via f80867ad3f59d2f1566329d70b7d81d8880b34e5 (commit)
via 21418d1705521474d3cd663ab7d0c8a90a124c96 (commit)
from ef85bc4e70f3d37c59f2fe57bf6eefa8b1df567f (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 a6cf282777a0aa3477f725695c38eb072f97e599
Author: QuzarDC <qu...@co...>
Date: Fri Aug 15 13:01:03 2025 -0400
examples: Remove last arch/types.h type usage from examples.
commit 2df8eac788c9eb90779171feca7e8ba28e0f965c
Author: QuzarDC <qu...@co...>
Date: Fri Aug 15 12:29:10 2025 -0400
addons: Remove arch/types.h types.
Additionally minor whitespace cleanups.
commit 2ea09fd2eb5ac0ddea0f1998bbe62d7b25b6a561
Author: QuzarDC <qu...@co...>
Date: Fri Aug 15 00:41:42 2025 -0400
Replace arch/types.h types in remaining misc kernel files.
commit f80867ad3f59d2f1566329d70b7d81d8880b34e5
Author: QuzarDC <qu...@co...>
Date: Fri Aug 15 00:28:56 2025 -0400
fs: Remove arch/types.h types.
Additionaly some minor whitespace cleanups.
commit 21418d1705521474d3cd663ab7d0c8a90a124c96
Author: QuzarDC <qu...@co...>
Date: Thu Aug 14 20:44:09 2025 -0400
net: Remove left behind usages of `arch/types.h` types.
A reflection of the fact that I did these by hand in #1102,
it seems as though I missed a few.
-----------------------------------------------------------------------
Summary of changes:
addons/include/kos/img.h | 12 ++---
addons/include/kos/md5.h | 14 +++---
addons/include/kos/netcfg.h | 22 ++++-----
addons/include/navi/flash.h | 6 +--
addons/include/navi/ide.h | 8 ++--
addons/libkosext2fs/fs_ext2.c | 2 +-
addons/libkosfat/fs_fat.c | 2 +-
addons/libkosutils/md5.c | 50 ++++++++++----------
addons/libkosutils/netcfg.c | 16 +++----
addons/libkosutils/pcx_small.c | 47 +++++++++----------
addons/libnavi/navi_flash.c | 20 ++++----
addons/libnavi/navi_ide.c | 45 +++++++++---------
addons/libppp/ipcp.c | 24 +++++-----
addons/libppp/ppp.c | 6 +--
.../dreamcast/keyboard/keyrawtest/keyrawtest.c | 6 +--
include/kos/dbgio.h | 12 ++---
include/kos/exports.h | 1 -
include/kos/fs.h | 12 ++---
include/kos/fs_socket.h | 5 +-
include/kos/library.h | 2 +-
include/kos/net.h | 2 +-
include/kos/thread.h | 2 +-
kernel/debug/dbgio.c | 12 ++---
kernel/fs/fs.c | 24 +++++-----
kernel/fs/fs_dev.c | 1 -
kernel/fs/fs_null.c | 1 -
kernel/fs/fs_pty.c | 40 ++++++++--------
kernel/fs/fs_random.c | 1 -
kernel/fs/fs_socket.c | 2 +-
kernel/fs/fs_utils.c | 12 ++---
kernel/libc/koslib/malloc.c | 54 +++++++++++-----------
kernel/mm/malloc_debug.c | 46 +++++++++---------
kernel/net/net_dhcp.c | 4 +-
kernel/net/net_icmp6.c | 4 +-
kernel/net/net_ipv4.c | 2 +-
kernel/net/net_ipv4_frag.c | 4 +-
kernel/net/net_ipv6.h | 2 +-
kernel/net/net_ndp.c | 2 +-
kernel/net/net_tcp.c | 2 +-
kernel/net/net_udp.c | 2 +-
40 files changed, 260 insertions(+), 271 deletions(-)
diff --git a/addons/include/kos/img.h b/addons/include/kos/img.h
index ea13cbc8..70c50dd8 100644
--- a/addons/include/kos/img.h
+++ b/addons/include/kos/img.h
@@ -26,7 +26,7 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
-#include <arch/types.h>
+#include <stdint.h>
/** \defgroup video_img Images
\brief Platform-independent image representation
@@ -49,13 +49,13 @@ __BEGIN_DECLS
\headerfile kos/img.h
*/
typedef struct kos_img {
- void *data; /**< \brief Image data in the specified format. */
- uint32 w; /**< \brief Width of the image. */
- uint32 h; /**< \brief Height of the image. */
- uint32 fmt; /**< \brief Format of the image data.
+ void *data; /**< \brief Image data in the specified format. */
+ uint32_t w; /**< \brief Width of the image. */
+ uint32_t h; /**< \brief Height of the image. */
+ uint32_t fmt; /**< \brief Format of the image data.
\see kos_img_fmts
\see kos_img_fmt_macros */
- uint32 byte_count; /**< \brief Length of the image data, in bytes. */
+ uint32_t byte_count; /**< \brief Length of the image data, in bytes. */
} kos_img_t;
/** \defgroup video_img_fmt Format
diff --git a/addons/include/kos/md5.h b/addons/include/kos/md5.h
index aecd5e47..63dbd31b 100644
--- a/addons/include/kos/md5.h
+++ b/addons/include/kos/md5.h
@@ -20,7 +20,7 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
-#include <arch/types.h>
+#include <stdint.h>
/** \brief MD5 context.
@@ -31,9 +31,9 @@ __BEGIN_DECLS
\headerfile kos/md5.h
*/
typedef struct kos_md5_cxt {
- uint64 size; /**< \brief Size of the data in buf. */
- uint32 hash[4]; /**< \brief Intermediate hash value. */
- uint8 buf[64]; /**< \brief Temporary storage of values to be hashed. */
+ uint64_t size; /**< \brief Size of the data in buf. */
+ uint32_t hash[4]; /**< \brief Intermediate hash value. */
+ uint8_t buf[64]; /**< \brief Temporary storage of values to be hashed. */
} kos_md5_cxt_t;
/** \brief Initialize a MD5 context.
@@ -58,7 +58,7 @@ void kos_md5_start(kos_md5_cxt_t *cxt);
\param input The block of data to hash.
\param size The number of bytes of input data passed in.
*/
-void kos_md5_hash_block(kos_md5_cxt_t *cxt, const uint8 *input, uint32 size);
+void kos_md5_hash_block(kos_md5_cxt_t *cxt, const uint8_t *input, uint32_t size);
/** \brief Complete a MD5 hash.
@@ -68,7 +68,7 @@ void kos_md5_hash_block(kos_md5_cxt_t *cxt, const uint8 *input, uint32 size);
\param cxt The MD5 context to finalize.
\param output Where to store the final digest.
*/
-void kos_md5_finish(kos_md5_cxt_t *cxt, uint8 output[16]);
+void kos_md5_finish(kos_md5_cxt_t *cxt, uint8_t output[16]);
/** \brief Compute the hash of a block of data with MD5.
@@ -81,7 +81,7 @@ void kos_md5_finish(kos_md5_cxt_t *cxt, uint8 output[16]);
\param size The number of bytes of input data passed in.
\param output Where to store the final message digest.
*/
-void kos_md5(const uint8 *input, uint32 size, uint8 output[16]);
+void kos_md5(const uint8_t *input, uint32_t size, uint8_t output[16]);
__END_DECLS
diff --git a/addons/include/kos/netcfg.h b/addons/include/kos/netcfg.h
index 5ea10361..3597d42d 100644
--- a/addons/include/kos/netcfg.h
+++ b/addons/include/kos/netcfg.h
@@ -26,7 +26,7 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
-#include <arch/types.h>
+#include <stdint.h>
/** \defgroup netcfg Configuration
\brief KOS Network Configuration Management
@@ -83,11 +83,11 @@ typedef struct netcfg {
*/
int method;
- uint32 ip; /**< \brief IPv4 address of the console */
- uint32 gateway; /**< \brief IPv4 address of the gateway/router. */
- uint32 netmask; /**< \brief Network mask for the local net. */
- uint32 broadcast; /**< \brief Broadcast address for the local net. */
- uint32 dns[2]; /**< \brief IPv4 address of the DNS servers. */
+ uint32_t ip; /**< \brief IPv4 address of the console */
+ uint32_t gateway; /**< \brief IPv4 address of the gateway/router. */
+ uint32_t netmask; /**< \brief Network mask for the local net. */
+ uint32_t broadcast; /**< \brief Broadcast address for the local net. */
+ uint32_t dns[2]; /**< \brief IPv4 address of the DNS servers. */
char hostname[64]; /**< \brief DNS/DHCP hostname. */
char email[64]; /**< \brief E-Mail address. */
char smtp[64]; /**< \brief SMTP server address. */
@@ -114,7 +114,7 @@ typedef struct netcfg {
\return 0 on success, <0 on failure.
*/
-int netcfg_load_from(const char * fn, netcfg_t * out);
+int netcfg_load_from(const char *fn, netcfg_t *out);
/** \brief Load network configuration from the Dreamcast's flashrom.
\ingroup netcfg
@@ -129,7 +129,7 @@ int netcfg_load_from(const char * fn, netcfg_t * out);
\return 0 on success, <0 on failure.
*/
-int netcfg_load_flash(netcfg_t * out);
+int netcfg_load_flash(netcfg_t *out);
/** \brief Load network configuration.
\ingroup netcfg
@@ -144,7 +144,7 @@ int netcfg_load_flash(netcfg_t * out);
\return 0 on success, <0 on failure.
*/
-int netcfg_load(netcfg_t * out);
+int netcfg_load(netcfg_t *out);
/** \brief Save network configuration to a file.
\ingroup netcfg
@@ -158,7 +158,7 @@ int netcfg_load(netcfg_t * out);
\return 0 on success, <0 on failure.
*/
-int netcfg_save_to(const char * fn, const netcfg_t * cfg);
+int netcfg_save_to(const char *fn, const netcfg_t *cfg);
/** \brief Save network configuration to the first available VMU.
\ingroup netcfg
@@ -170,7 +170,7 @@ int netcfg_save_to(const char * fn, const netcfg_t * cfg);
\return 0 on success, <0 on failure.
*/
-int netcfg_save(const netcfg_t * cfg);
+int netcfg_save(const netcfg_t *cfg);
__END_DECLS
diff --git a/addons/include/navi/flash.h b/addons/include/navi/flash.h
index 887ef3b6..13fa2c97 100644
--- a/addons/include/navi/flash.h
+++ b/addons/include/navi/flash.h
@@ -19,7 +19,7 @@
#ifndef __NAVI_FLASH_H
#define __NAVI_FLASH_H
-#include <arch/types.h>
+#include <stdint.h>
/** \brief Try to detect a compatible flashrom.
\return 0 if a compatible flashrom is detected, <0 if the
@@ -31,7 +31,7 @@ int nvflash_detect(void);
\param addr The block of the flashrom to erase.
\return 0 on success, <0 on error.
*/
-int nvflash_erase_block(uint32 addr);
+int nvflash_erase_block(uint32_t addr);
/** \brief Write data to the flashrom.
\param addr The block of the flashrom to write to.
@@ -39,7 +39,7 @@ int nvflash_erase_block(uint32 addr);
\param len The length of the data, in bytes.
\return 0 on success, <0 on error.
*/
-int nvflash_write_block(uint32 addr, void * data, uint32 len);
+int nvflash_write_block(uint32_t addr, void *data, uint32_t len);
/* Erase the whole flash chip */
/** \brief Erase the whole flashrom.
diff --git a/addons/include/navi/ide.h b/addons/include/navi/ide.h
index 346305c0..71ef0fef 100644
--- a/addons/include/navi/ide.h
+++ b/addons/include/navi/ide.h
@@ -19,7 +19,7 @@
#ifndef __NAVI_IDE_H
#define __NAVI_IDE_H
-#include <arch/types.h>
+#include <stdint.h>
/** \brief Read sectors from the hard disk via PIO.
\param linear The address to begin reading from.
@@ -27,7 +27,7 @@
\param bufptr The buffer to read into.
\return 0 on success, <0 on error.
*/
-int ide_read(uint32 linear, uint32 numsects, void *bufptr);
+int ide_read(uint32_t linear, uint32_t numsects, void *bufptr);
/** \brief Write sectors from the hard disk via PIO.
\param linear The address to begin writing to.
@@ -35,12 +35,12 @@ int ide_read(uint32 linear, uint32 numsects, void *bufptr);
\param bufptr The buffer to write out of.
\return 0 on success, <0 on error.
*/
-int ide_write(uint32 linear, uint32 numsects, void *bufptr);
+int ide_write(uint32_t linear, uint32_t numsects, void *bufptr);
/** \brief Retrieve the number of sectors from the hard disk.
\returns The total number of linear sectors.
*/
-uint32 ide_num_sectors(void);
+uint32_t ide_num_sectors(void);
/** \brief Initialize Navi IDE.
\return 0 on success (no error conditions defined).
diff --git a/addons/libkosext2fs/fs_ext2.c b/addons/libkosext2fs/fs_ext2.c
index fa407b48..e67b4ab9 100644
--- a/addons/libkosext2fs/fs_ext2.c
+++ b/addons/libkosext2fs/fs_ext2.c
@@ -540,7 +540,7 @@ static _off64_t fs_ext2_tell64(void *h) {
return rv;
}
-static uint64 fs_ext2_total64(void *h) {
+static uint64_t fs_ext2_total64(void *h) {
file_t fd = ((file_t)h) - 1;
size_t rv;
diff --git a/addons/libkosfat/fs_fat.c b/addons/libkosfat/fs_fat.c
index 373bc3e2..e8cf7b9b 100644
--- a/addons/libkosfat/fs_fat.c
+++ b/addons/libkosfat/fs_fat.c
@@ -740,7 +740,7 @@ static _off64_t fs_fat_tell64(void *h) {
return rv;
}
-static uint64 fs_fat_total64(void *h) {
+static uint64_t fs_fat_total64(void *h) {
file_t fd = ((file_t)h) - 1;
size_t rv;
diff --git a/addons/libkosutils/md5.c b/addons/libkosutils/md5.c
index 87667f28..a10d6807 100644
--- a/addons/libkosutils/md5.c
+++ b/addons/libkosutils/md5.c
@@ -5,18 +5,16 @@
*/
#include <string.h>
-#include <arch/types.h>
-
#include <kos/md5.h>
/* Initial values used in starting the MD5 checksum */
-static const uint32 md5initial[4] = {
+static const uint32_t md5initial[4] = {
0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476
};
/* We will append somewhere between 1 and 64 bytes of padding to every message,
depending on its length. This is the padding that is to be used. */
-static const uint8 md5padding[64] = {
+static const uint8_t md5padding[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -24,7 +22,7 @@ static const uint8 md5padding[64] = {
};
/* MD5 "magic" values */
-static const uint32 md5tab[64] = {
+static const uint32_t md5tab[64] = {
0xD76AA478, 0xE8C7B756, 0x242070DB, 0xC1BDCEEE,
0xF57C0FAF, 0x4787C62A, 0xA8304613, 0xFD469501,
0x698098D8, 0x8B44F7AF, 0xFFFF5BB1, 0x895CD7BE,
@@ -52,7 +50,7 @@ int main(int argc, char *argv[]) {
int i;
double tmp;
- printf("static const uint32 md5tab[64] = {");
+ printf("static const uint32_t md5tab[64] = {");
for(i = 0; i < 64; ++i) {
if((i % 4) == 0)
@@ -119,8 +117,8 @@ void kos_md5_start(kos_md5_cxt_t *cxt) {
}
/* input must be at least 64 bytes long */
-static void kos_md5_process(kos_md5_cxt_t *cxt, const uint8 *input) {
- uint32 a, b, c, d, w[16];
+static void kos_md5_process(kos_md5_cxt_t *cxt, const uint8_t *input) {
+ uint32_t a, b, c, d, w[16];
int i;
/* Read in what we're starting with */
@@ -214,11 +212,11 @@ static void kos_md5_process(kos_md5_cxt_t *cxt, const uint8 *input) {
cxt->hash[3] += d;
}
-void kos_md5_hash_block(kos_md5_cxt_t *cxt, const uint8 *input, uint32 size) {
- uint32 left, copy;
+void kos_md5_hash_block(kos_md5_cxt_t *cxt, const uint8_t *input, uint32_t size) {
+ uint32_t left, copy;
/* Figure out what we had left over from last time (if anything) */
- left = (uint32)((cxt->size >> 3) & 0x3F);
+ left = (uint32_t)((cxt->size >> 3) & 0x3F);
copy = 64 - left;
/* Update the size */
@@ -246,35 +244,35 @@ void kos_md5_hash_block(kos_md5_cxt_t *cxt, const uint8 *input, uint32 size) {
}
}
-void kos_md5_finish(kos_md5_cxt_t *cxt, uint8 output[16]) {
- uint64 len = cxt->size;
- uint32 blen = (cxt->size >> 3) & 0x3F;
- uint32 plen = MD5_PAD_LEN(blen);
+void kos_md5_finish(kos_md5_cxt_t *cxt, uint8_t output[16]) {
+ uint64_t len = cxt->size;
+ uint32_t blen = (cxt->size >> 3) & 0x3F;
+ uint32_t plen = MD5_PAD_LEN(blen);
int i;
- uint8 len_bytes[8];
+ uint8_t len_bytes[8];
/* Add in the padding */
kos_md5_hash_block(cxt, md5padding, plen);
/* Hash in the length -- this will finish the last 64-byte block */
- len_bytes[0] = (uint8)(len);
- len_bytes[1] = (uint8)(len >> 8);
- len_bytes[2] = (uint8)(len >> 16);
- len_bytes[3] = (uint8)(len >> 24);
- len_bytes[4] = (uint8)(len >> 32);
- len_bytes[5] = (uint8)(len >> 40);
- len_bytes[6] = (uint8)(len >> 48);
- len_bytes[7] = (uint8)(len >> 56);
+ len_bytes[0] = (uint8_t)(len);
+ len_bytes[1] = (uint8_t)(len >> 8);
+ len_bytes[2] = (uint8_t)(len >> 16);
+ len_bytes[3] = (uint8_t)(len >> 24);
+ len_bytes[4] = (uint8_t)(len >> 32);
+ len_bytes[5] = (uint8_t)(len >> 40);
+ len_bytes[6] = (uint8_t)(len >> 48);
+ len_bytes[7] = (uint8_t)(len >> 56);
kos_md5_hash_block(cxt, len_bytes, 8);
/* Copy out the hash, since we're done */
for(i = 0; i < 16; ++i) {
- output[i] = (uint8)(cxt->hash[i >> 2] >> ((i & 0x03) << 3));
+ output[i] = (uint8_t)(cxt->hash[i >> 2] >> ((i & 0x03) << 3));
}
}
/* Convenience function for computing an MD5 of a complete block. */
-void kos_md5(const uint8 *input, uint32 size, uint8 output[16]) {
+void kos_md5(const uint8_t *input, uint32_t size, uint8_t output[16]) {
kos_md5_cxt_t cxt;
kos_md5_start(&cxt);
diff --git a/addons/libkosutils/netcfg.c b/addons/libkosutils/netcfg.c
index df38d593..e95ef307 100644
--- a/addons/libkosutils/netcfg.c
+++ b/addons/libkosutils/netcfg.c
@@ -25,13 +25,13 @@
void netcfg_vmuify(const char *filename_in, const char *filename_out) {
int fd, pkg_size;
- uint8 *buf;
- uint8 *pkg_out;
+ uint8_t *buf;
+ uint8_t *pkg_out;
vmu_pkg_t pkg;
dbgp("Opening source file\n");
fd = fs_open(filename_in, O_RDONLY);
- buf = (uint8 *) malloc(fs_total(fd));
+ buf = (uint8_t *) malloc(fs_total(fd));
if(buf == NULL)
return;
@@ -69,7 +69,7 @@ void netcfg_vmuify(const char *filename_in, const char *filename_out) {
this fails, we try reading settings from the current dir in the VFS,
and then from the root of the CD. If that fails, we give up. */
-int netcfg_load_from(const char * fn, netcfg_t * out) {
+int netcfg_load_from(const char *fn, netcfg_t *out) {
FILE * f;
char buf[64], *b;
int l;
@@ -189,7 +189,7 @@ int netcfg_load_from(const char * fn, netcfg_t * out) {
return 0;
}
-int netcfg_load_flash(netcfg_t * out) {
+int netcfg_load_flash(netcfg_t *out) {
flashrom_ispcfg_t cfg;
if(flashrom_get_ispcfg(&cfg) < 0)
@@ -256,7 +256,7 @@ int netcfg_load_flash(netcfg_t * out) {
return 0;
}
-int netcfg_load(netcfg_t * out) {
+int netcfg_load(netcfg_t *out) {
file_t f;
dirent_t * d;
char buf[64];
@@ -305,7 +305,7 @@ int netcfg_load(netcfg_t * out) {
return -1;
}
-int netcfg_save_to(const char * fn, const netcfg_t * cfg) {
+int netcfg_save_to(const char *fn, const netcfg_t *cfg) {
FILE * f;
char buf[256];
@@ -383,7 +383,7 @@ error:
return -1;
}
-int netcfg_save(const netcfg_t * cfg) {
+int netcfg_save(const netcfg_t *cfg) {
file_t f;
dirent_t * d;
char buf[64];
diff --git a/addons/libkosutils/pcx_small.c b/addons/libkosutils/pcx_small.c
index 0dc8faa6..e133e3d9 100644
--- a/addons/libkosutils/pcx_small.c
+++ b/addons/libkosutils/pcx_small.c
@@ -7,7 +7,6 @@
*/
#include <stdio.h>
-#include <arch/types.h>
#include <kos/fs.h>
#include <kos/pcx.h>
@@ -17,15 +16,15 @@ 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 */
...<truncated>...
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-15 01:16:32
|
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 ef85bc4e70f3d37c59f2fe57bf6eefa8b1df567f (commit)
from a2dbeec5733a885c1f79345d01387b6be9346e32 (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 ef85bc4e70f3d37c59f2fe57bf6eefa8b1df567f
Author: QuzarDC <qu...@co...>
Date: Thu Aug 14 19:18:37 2025 -0400
vmu_lcd example: Add wait after draw to throttle animation.
The example never attempted to throttle itself because the
screen drawing commands were synchronous and would wait to
receive a response from the VMU before moving forward with
execution. With the changes in #904 there is no wait and
the user is responsible for throttling the drawing.
Without this the example is illegible on the VMU screen,
updating faster than can be seen. This wait amount gets it
back down to a pace similar to before.
-----------------------------------------------------------------------
Summary of changes:
examples/dreamcast/vmu/vmu_lcd/lcd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/examples/dreamcast/vmu/vmu_lcd/lcd.c b/examples/dreamcast/vmu/vmu_lcd/lcd.c
index 7cb4ba68..4e218059 100644
--- a/examples/dreamcast/vmu/vmu_lcd/lcd.c
+++ b/examples/dreamcast/vmu/vmu_lcd/lcd.c
@@ -76,6 +76,9 @@ int main(int argc, char **argv) {
for(vmu = 0; !!(dev = maple_enum_type(vmu, MAPLE_FUNC_LCD)); vmu++) {
vmufb_present(&vmufb, dev);
}
+
+ /* Now sleep for a bit so we can actually see the new frame */
+ usleep(2000);
}
return 0;
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-14 23:34: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 a2dbeec5733a885c1f79345d01387b6be9346e32 (commit)
from e655808a8d4b52640f0524210985f3978901d8c6 (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 a2dbeec5733a885c1f79345d01387b6be9346e32
Author: Paul Cercueil <pa...@cr...>
Date: Wed Aug 6 14:00:36 2025 +0200
CI: Add whitespace check
Fail if some commits in a given pull request have whitespace issues.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
.github/workflows/whitespace.yml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 .github/workflows/whitespace.yml
diff --git a/.github/workflows/whitespace.yml b/.github/workflows/whitespace.yml
new file mode 100644
index 00000000..79027b72
--- /dev/null
+++ b/.github/workflows/whitespace.yml
@@ -0,0 +1,18 @@
+name: Whitespace check
+
+on: pull_request
+
+jobs:
+ check:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+
+ - name: Whitespace check
+ run: |
+ git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
+ git diff ${{ github.base_ref }} >/tmp/diff1.txt
+ git diff -w ${{ github.base_ref }} >/tmp/diff2.txt
+ diff /tmp/diff1.txt /tmp/diff2.txt >/dev/null
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-14 20:18: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 e655808a8d4b52640f0524210985f3978901d8c6 (commit)
via 03df46db210ee53614bfb31b7c576177d02409c4 (commit)
from 1e6a1b3041ee8aebe2845c07b9ac3436b9f5fd81 (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 e655808a8d4b52640f0524210985f3978901d8c6
Author: QuzarDC <qu...@co...>
Date: Mon Aug 11 23:59:22 2025 -0400
examples: More stable exec example
The changes made in #1112 to make the romdisk vfs
dynamically allocate file handles had a side effect
of being more likely to break this exec example.
This happens because the example was using `fs_mmap`
with a hidden assumption that the memory allocated for
the open rd file would persist through the
`arch_shutdown` that happens during `arch_exec`.
This only ever worked because of the specifics of how the
example were being crafted: having the subelf in a static
romdisk built into the loaded parent binary and could have
failed before #1112 with any mildly different use like loading
a romdisk from a disc first.
commit 03df46db210ee53614bfb31b7c576177d02409c4
Author: QuzarDC <qu...@co...>
Date: Tue Aug 12 01:15:59 2025 -0400
fs_romdisk: Correct `fs_romdisk_shutdown`
The changes in #1112 broke `fs_romdisk_shutdown` when
any files were left open (found via exec example).
The problem was that the functionality to free dangling
file handles would deadlock with the already open mutex.
-----------------------------------------------------------------------
Summary of changes:
examples/dreamcast/basic/exec/exec.c | 30 ++++++++++++++++++++++++------
kernel/fs/fs_romdisk.c | 8 ++++----
2 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/examples/dreamcast/basic/exec/exec.c b/examples/dreamcast/basic/exec/exec.c
index edcb201d..0fd34be6 100644
--- a/examples/dreamcast/basic/exec/exec.c
+++ b/examples/dreamcast/basic/exec/exec.c
@@ -9,20 +9,38 @@
int main(int argc, char **argv) {
file_t f;
- void *subelf;
+ size_t s;
+ ssize_t rv;
+ void *subbin;
/* Print a hello */
printf("\n\nHello world from the exec.elf process\n");
- /* Map the sub-elf */
+ /* Open the sub-bin. Note normally this wouldn't be from a
+ romdisk as that means that you'd already have it loaded
+ in memory.
+ */
f = fs_open("/rd/sub.bin", O_RDONLY);
assert(f);
- subelf = fs_mmap(f);
- assert(subelf);
+
+ /* Get the size of sub.bin */
+ s = fs_total(f);
+ assert(s);
+
+ /* Allocate space for it */
+ subbin = malloc(s);
+ assert(subbin);
+
+ /* Copy in the sub.bin */
+ rv = fs_read(f, subbin, s);
+ assert(rv == s);
+
+ /* Lets be nice and tidy up after ourselves */
+ fs_close(f);
/* Tell exec to replace us */
- printf("sub.bin mapped at %08x, jumping to it!\n\n\n", (unsigned int)subelf);
- arch_exec(subelf, fs_total(f));
+ printf("sub.bin loaded at %08x, jumping to it!\n\n\n", (uintptr_t)subbin);
+ arch_exec(subbin, s);
/* Shouldn't get here */
assert_msg(false, "exec call failed");
diff --git a/kernel/fs/fs_romdisk.c b/kernel/fs/fs_romdisk.c
index b2bc3784..39de9e4b 100644
--- a/kernel/fs/fs_romdisk.c
+++ b/kernel/fs/fs_romdisk.c
@@ -672,6 +672,8 @@ void fs_romdisk_shutdown(void) {
if(!initted)
return;
+ initted = 0;
+
mutex_lock(&fh_mutex);
/* Go through and free all the romdisk mount entries */
@@ -679,17 +681,15 @@ void fs_romdisk_shutdown(void) {
fs_romdisk_list_remove(c);
}
+ mutex_unlock(&fh_mutex);
+
/* Iterate through any dangling files and clean them */
TAILQ_FOREACH_SAFE(i, &rd_fd_queue, next, j) {
romdisk_close(i);
}
- mutex_unlock(&fh_mutex);
-
/* Free mutex */
mutex_destroy(&fh_mutex);
-
- initted = 0;
}
/* Mount a romdisk image; must have called fs_romdisk_init() earlier.
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-12 00:57:54
|
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 1e6a1b3041ee8aebe2845c07b9ac3436b9f5fd81 (commit)
from 92a3b3595f7e66494fedbf55dad9dea281aeb29c (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 1e6a1b3041ee8aebe2845c07b9ac3436b9f5fd81
Author: darc <da...@pr...>
Date: Mon Aug 11 15:35:51 2025 -0500
Reorder linker script inputs to place crtn.o after crtend.o
Without the proper ordering, C++ applications immediately crash
-----------------------------------------------------------------------
Summary of changes:
utils/ldscripts/shlelf.xc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/ldscripts/shlelf.xc b/utils/ldscripts/shlelf.xc
index 57af3b60..8569537c 100644
--- a/utils/ldscripts/shlelf.xc
+++ b/utils/ldscripts/shlelf.xc
@@ -5,8 +5,8 @@ OUTPUT_ARCH(sh)
STARTUP(_kos_startup.o)
INPUT(crti.o)
INPUT(crtbegin.o)
-INPUT(crtn.o)
INPUT(crtend.o)
+INPUT(crtn.o)
LOAD_OFFSET = DEFINED(LOAD_OFFSET) ? LOAD_OFFSET : 0x8c010000 ;
SECTIONS
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-08 21:08:58
|
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 92a3b3595f7e66494fedbf55dad9dea281aeb29c (commit)
from 09aed298cbfbc1e2a9ab88342f17b44cd9893510 (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 92a3b3595f7e66494fedbf55dad9dea281aeb29c
Author: Paul Cercueil <pa...@cr...>
Date: Fri Aug 8 16:35:13 2025 +0200
dc-chain: Remove fake KOS objects from libgcc after build
This should not be necessary and I don't understand why we need this;
the symbols inside fake-kos.o are all weak, and should all be replaced
by symbols provided by libkallisti.a. Alas, this does not seem to work
reliably, and cause crashes and issues that are hard to debug.
Address these issues by just dropping the fake-kos.o object from the
libgcc.a archive.
Signed-off-by: Paul Cercueil <pa...@cr...>
-----------------------------------------------------------------------
Summary of changes:
utils/dc-chain/scripts/gcc-pass2.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/utils/dc-chain/scripts/gcc-pass2.mk b/utils/dc-chain/scripts/gcc-pass2.mk
index 644eb665..f4096fea 100644
--- a/utils/dc-chain/scripts/gcc-pass2.mk
+++ b/utils/dc-chain/scripts/gcc-pass2.mk
@@ -32,4 +32,5 @@ ifdef enable_ada
endif
endif
$(MAKE) -C $(build) $(install_mode) DESTDIR=$(DESTDIR) $(to_log)
+ $(target)-gcc-ar d $(shell $(target)-gcc -print-file-name=libgcc.a) fake-kos.o
$(clean_up)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-08 12:57: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 09aed298cbfbc1e2a9ab88342f17b44cd9893510 (commit)
from 5f607420fef4b10ff0df073c1bd37b79eb09a136 (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 09aed298cbfbc1e2a9ab88342f17b44cd9893510
Author: darc <da...@pr...>
Date: Mon Aug 4 14:47:20 2025 -0500
Update 15.x profiles to 15.2.0/15.2.1-dev. All dev profiles upgraded to Binutils 2.45 and GDB 16.3
-----------------------------------------------------------------------
Summary of changes:
utils/dc-chain/Makefile.dreamcast.cfg | 5 ++-
utils/dc-chain/Makefile.gamecube.cfg | 2 +-
utils/dc-chain/doc/CHANGELOG.md | 1 +
.../{gcc-15.1.0-kos.diff => gcc-15.2.0-kos.diff} | 46 +++++++++++-----------
.../{gcc-15.1.1-kos.diff => gcc-15.2.1-kos.diff} | 46 +++++++++++-----------
utils/dc-chain/profiles/aica/stable.mk | 2 +-
utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk | 4 +-
utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk | 4 +-
utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk | 2 +-
.../profiles/dreamcast/{15.1.0.mk => 15.2.0.mk} | 6 +--
.../dreamcast/{15.1.1-dev.mk => 15.2.1-dev.mk} | 8 ++--
utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk | 4 +-
utils/dc-chain/profiles/gamecube/stable.mk | 6 +--
13 files changed, 69 insertions(+), 67 deletions(-)
rename utils/dc-chain/patches/targets/{gcc-15.1.0-kos.diff => gcc-15.2.0-kos.diff} (73%)
rename utils/dc-chain/patches/targets/{gcc-15.1.1-kos.diff => gcc-15.2.1-kos.diff} (73%)
rename utils/dc-chain/profiles/dreamcast/{15.1.0.mk => 15.2.0.mk} (94%)
rename utils/dc-chain/profiles/dreamcast/{15.1.1-dev.mk => 15.2.1-dev.mk} (92%)
diff --git a/utils/dc-chain/Makefile.dreamcast.cfg b/utils/dc-chain/Makefile.dreamcast.cfg
index 14ac30ad..513319e6 100644
--- a/utils/dc-chain/Makefile.dreamcast.cfg
+++ b/utils/dc-chain/Makefile.dreamcast.cfg
@@ -17,11 +17,12 @@ platform=dreamcast
# - stable: Stable: Well-tested; based on GCC 13.2.0, released 2023-07-27.
# - 13.4.0: Testing: Latest release in the GCC 13 series, released 2025-06-05.
# - 14.3.0: Testing: Latest release in the GCC 14 series, released 2025-05-23.
-# - 15.1.0: Testing: Latest release in the GCC 15 series, released 2025-04-25.
+# - 15.2.0: Testing: Latest release in the GCC 15 series, released 2025-08-08.
# Development toolchains:
# - 13.4.1-dev Bleeding edge GCC 13 series from git.
# - 14.3.1-dev Bleeding edge GCC 14 series from git.
-# - 15.1.1-dev Bleeding edge GCC 15 series from git.
+# - 15.0.0-lra GCC 15 branch containing experimental SuperH fixes for LRA.
+# - 15.2.1-dev Bleeding edge GCC 15 series from git.
# - 16.0.0-dev Bleeding edge GCC 16 series from git.
# If unsure, select stable. See README.md for more detailed descriptions.
toolchain_profile=stable
diff --git a/utils/dc-chain/Makefile.gamecube.cfg b/utils/dc-chain/Makefile.gamecube.cfg
index 2018bde0..aa6491d2 100644
--- a/utils/dc-chain/Makefile.gamecube.cfg
+++ b/utils/dc-chain/Makefile.gamecube.cfg
@@ -12,7 +12,7 @@
platform=gamecube
# Choose a toolchain profile from the following available options:
-# - stable: Stable: Well-tested; based on GCC 15.1.0, released 2025-04-25.
+# - stable: Stable: Well-tested; based on GCC 15.2.0, released 2025-08-08.
# If unsure, select stable. See README.md for more detailed descriptions.
toolchain_profile=stable
diff --git a/utils/dc-chain/doc/CHANGELOG.md b/utils/dc-chain/doc/CHANGELOG.md
index 8704aa20..e8aceb4e 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-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 |
| 2025-07-13 | Paul Cercueil | Add support for PPC toolchains and add GameCube profile |
diff --git a/utils/dc-chain/patches/targets/gcc-15.1.0-kos.diff b/utils/dc-chain/patches/targets/gcc-15.2.0-kos.diff
similarity index 73%
rename from utils/dc-chain/patches/targets/gcc-15.1.0-kos.diff
rename to utils/dc-chain/patches/targets/gcc-15.2.0-kos.diff
index 7b4c5364..e71c5109 100644
--- a/utils/dc-chain/patches/targets/gcc-15.1.0-kos.diff
+++ b/utils/dc-chain/patches/targets/gcc-15.2.0-kos.diff
@@ -1,6 +1,6 @@
-diff -ruN gcc-15.1.0/gcc/config/elfos.h gcc-15.1.0-kos/gcc/config/elfos.h
---- gcc-15.1.0/gcc/config/elfos.h 2025-04-17 16:01:33.790051712 -0600
-+++ gcc-15.1.0-kos/gcc/config/elfos.h 2025-04-17 16:01:42.910094466 -0600
+diff -ruN gcc-15.2.0/gcc/config/elfos.h gcc-15.2.0-kos/gcc/config/elfos.h
+--- gcc-15.2.0/gcc/config/elfos.h 2025-04-17 16:01:33.790051712 -0600
++++ gcc-15.2.0-kos/gcc/config/elfos.h 2025-04-17 16:01:42.910094466 -0600
@@ -486,3 +486,6 @@
#undef TARGET_LIBC_HAS_FUNCTION
@@ -8,9 +8,9 @@ diff -ruN gcc-15.1.0/gcc/config/elfos.h gcc-15.1.0-kos/gcc/config/elfos.h
+
+#define TARGET_OS_CPP_BUILTINS() \
+ builtin_define ("__KOS_GCC_PATCHLEVEL__=2025062800")
-diff -ruN gcc-15.1.0/gcc/configure gcc-15.1.0-kos/gcc/configure
---- gcc-15.1.0/gcc/configure 2025-04-18 16:01:33.801051764 -0600
-+++ gcc-15.1.0-kos/gcc/configure 2025-04-18 16:01:42.913094480 -0600
+diff -ruN gcc-15.2.0/gcc/configure gcc-15.2.0-kos/gcc/configure
+--- gcc-15.2.0/gcc/configure 2025-04-18 16:01:33.801051764 -0600
++++ gcc-15.2.0-kos/gcc/configure 2025-04-18 16:01:42.913094480 -0600
@@ -13165,7 +13165,7 @@
target_thread_file='single'
;;
@@ -20,9 +20,9 @@ diff -ruN gcc-15.1.0/gcc/configure gcc-15.1.0-kos/gcc/configure
target_thread_file=${enable_threads}
;;
*)
-diff --color -ruN gcc-15.1.0/libgcc/config.host gcc-15.1.0-kos/libgcc/config.host
---- gcc-15.1.0/libgcc/config.host 2025-04-27 14:45:09.695053718 -0600
-+++ gcc-15.1.0-kos/libgcc/config.host 2025-04-27 15:10:10.267714917 -0600
+diff --color -ruN gcc-15.2.0/libgcc/config.host gcc-15.2.0-kos/libgcc/config.host
+--- gcc-15.2.0/libgcc/config.host 2025-04-27 14:45:09.695053718 -0600
++++ gcc-15.2.0-kos/libgcc/config.host 2025-04-27 15:10:10.267714917 -0600
@@ -71,7 +71,7 @@
asm_hidden_op=.hidden
enable_execute_stack=
@@ -32,14 +32,14 @@ diff --color -ruN gcc-15.1.0/libgcc/config.host gcc-15.1.0-kos/libgcc/config.hos
tm_file=
tm_define=
md_unwind_def_header=no-unwind.h
-diff -ruN /dev/null gcc-15.1.0-kos/libgcc/config/t-kos
+diff -ruN /dev/null gcc-15.2.0-kos/libgcc/config/t-kos
--- /dev/null 2025-04-27 14:45:09.695053718 -0600
-+++ gcc-15.1.0-kos/libgcc/config/t-kos 2025-04-27 15:10:10.267714917 -0600
++++ gcc-15.2.0-kos/libgcc/config/t-kos 2025-04-27 15:10:10.267714917 -0600
@@ -0,0 +1 @@
+LIB2ADD = $(srcdir)/config/fake-kos.c
-diff -ruN gcc-15.1.0/libgcc/configure gcc-15.1.0-kos/libgcc/configure
---- gcc-15.1.0/libgcc/configure 2025-04-18 16:01:37.139067412 -0600
-+++ gcc-15.1.0-kos/libgcc/configure 2025-04-18 16:01:42.914094485 -0600
+diff -ruN gcc-15.2.0/libgcc/configure gcc-15.2.0-kos/libgcc/configure
+--- gcc-15.2.0/libgcc/configure 2025-04-18 16:01:37.139067412 -0600
++++ gcc-15.2.0-kos/libgcc/configure 2025-04-18 16:01:42.914094485 -0600
@@ -5733,6 +5733,7 @@
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
@@ -48,9 +48,9 @@ diff -ruN gcc-15.1.0/libgcc/configure gcc-15.1.0-kos/libgcc/configure
mcf) thread_header=config/i386/gthr-mcf.h ;;
esac
-diff -ruN gcc-15.1.0/libobjc/Makefile.in gcc-15.1.0-kos/libobjc/Makefile.in
---- gcc-15.1.0/libobjc/Makefile.in 2025-04-18 16:01:37.499069099 -0600
-+++ gcc-15.1.0-kos/libobjc/Makefile.in 2025-04-18 16:01:42.915094489 -0600
+diff -ruN gcc-15.2.0/libobjc/Makefile.in gcc-15.2.0-kos/libobjc/Makefile.in
+--- gcc-15.2.0/libobjc/Makefile.in 2025-04-18 16:01:37.499069099 -0600
++++ gcc-15.2.0-kos/libobjc/Makefile.in 2025-04-18 16:01:42.915094489 -0600
@@ -308,14 +308,16 @@
$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
@@ -81,9 +81,9 @@ diff -ruN gcc-15.1.0/libobjc/Makefile.in gcc-15.1.0-kos/libobjc/Makefile.in
mostlyclean:
-$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
-diff -ruN gcc-15.1.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-15.1.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h
---- gcc-15.1.0/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:37.608069611 -0600
-+++ gcc-15.1.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:42.916094494 -0600
+diff -ruN gcc-15.2.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-15.2.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h
+--- gcc-15.2.0/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:37.608069611 -0600
++++ gcc-15.2.0-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:42.916094494 -0600
@@ -22,14 +22,40 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
@@ -134,9 +134,9 @@ diff -ruN gcc-15.1.0/libstdc++-v3/config/cpu/sh/atomicity.h gcc-15.1.0-kos/libst
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
-diff -ruN gcc-15.1.0/libstdc++-v3/configure gcc-15.1.0-kos/libstdc++-v3/configure
---- gcc-15.1.0/libstdc++-v3/configure 2025-04-18 16:01:37.616069648 -0600
-+++ gcc-15.1.0-kos/libstdc++-v3/configure 2025-04-18 16:01:42.919094508 -0600
+diff -ruN gcc-15.2.0/libstdc++-v3/configure gcc-15.2.0-kos/libstdc++-v3/configure
+--- gcc-15.2.0/libstdc++-v3/configure 2025-04-18 16:01:37.616069648 -0600
++++ gcc-15.2.0-kos/libstdc++-v3/configure 2025-04-18 16:01:42.919094508 -0600
@@ -15974,6 +15974,7 @@
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
diff --git a/utils/dc-chain/patches/targets/gcc-15.1.1-kos.diff b/utils/dc-chain/patches/targets/gcc-15.2.1-kos.diff
similarity index 73%
rename from utils/dc-chain/patches/targets/gcc-15.1.1-kos.diff
rename to utils/dc-chain/patches/targets/gcc-15.2.1-kos.diff
index a18cea83..f4659e82 100644
--- a/utils/dc-chain/patches/targets/gcc-15.1.1-kos.diff
+++ b/utils/dc-chain/patches/targets/gcc-15.2.1-kos.diff
@@ -1,6 +1,6 @@
-diff -ruN gcc-15.1.1/gcc/config/elfos.h gcc-15.1.1-kos/gcc/config/elfos.h
---- gcc-15.1.1/gcc/config/elfos.h 2025-04-17 16:01:33.790051712 -0600
-+++ gcc-15.1.1-kos/gcc/config/elfos.h 2025-04-17 16:01:42.910094466 -0600
+diff -ruN gcc-15.2.1/gcc/config/elfos.h gcc-15.2.1-kos/gcc/config/elfos.h
+--- gcc-15.2.1/gcc/config/elfos.h 2025-04-17 16:01:33.790051712 -0600
++++ gcc-15.2.1-kos/gcc/config/elfos.h 2025-04-17 16:01:42.910094466 -0600
@@ -486,3 +486,6 @@
#undef TARGET_LIBC_HAS_FUNCTION
@@ -8,9 +8,9 @@ diff -ruN gcc-15.1.1/gcc/config/elfos.h gcc-15.1.1-kos/gcc/config/elfos.h
+
+#define TARGET_OS_CPP_BUILTINS() \
+ builtin_define ("__KOS_GCC_PATCHLEVEL__=2025062800")
-diff -ruN gcc-15.1.1/gcc/configure gcc-15.1.1-kos/gcc/configure
---- gcc-15.1.1/gcc/configure 2025-04-18 16:01:33.801051764 -0600
-+++ gcc-15.1.1-kos/gcc/configure 2025-04-18 16:01:42.913094480 -0600
+diff -ruN gcc-15.2.1/gcc/configure gcc-15.2.1-kos/gcc/configure
+--- gcc-15.2.1/gcc/configure 2025-04-18 16:01:33.801051764 -0600
++++ gcc-15.2.1-kos/gcc/configure 2025-04-18 16:01:42.913094480 -0600
@@ -13165,7 +13165,7 @@
target_thread_file='single'
;;
@@ -20,9 +20,9 @@ diff -ruN gcc-15.1.1/gcc/configure gcc-15.1.1-kos/gcc/configure
target_thread_file=${enable_threads}
;;
*)
-diff --color -ruN gcc-15.1.1/libgcc/config.host gcc-15.1.1-kos/libgcc/config.host
---- gcc-15.1.1/libgcc/config.host 2025-04-27 14:45:09.695053718 -0600
-+++ gcc-15.1.1-kos/libgcc/config.host 2025-04-27 15:10:10.267714917 -0600
+diff --color -ruN gcc-15.2.1/libgcc/config.host gcc-15.2.1-kos/libgcc/config.host
+--- gcc-15.2.1/libgcc/config.host 2025-04-27 14:45:09.695053718 -0600
++++ gcc-15.2.1-kos/libgcc/config.host 2025-04-27 15:10:10.267714917 -0600
@@ -71,7 +71,7 @@
asm_hidden_op=.hidden
enable_execute_stack=
@@ -32,14 +32,14 @@ diff --color -ruN gcc-15.1.1/libgcc/config.host gcc-15.1.1-kos/libgcc/config.hos
tm_file=
tm_define=
md_unwind_def_header=no-unwind.h
-diff -ruN /dev/null gcc-15.1.1-kos/libgcc/config/t-kos
+diff -ruN /dev/null gcc-15.2.1-kos/libgcc/config/t-kos
--- /dev/null 2025-04-27 14:45:09.695053718 -0600
-+++ gcc-15.1.1-kos/libgcc/config/t-kos 2025-04-27 15:10:10.267714917 -0600
++++ gcc-15.2.1-kos/libgcc/config/t-kos 2025-04-27 15:10:10.267714917 -0600
@@ -0,0 +1 @@
+LIB2ADD = $(srcdir)/config/fake-kos.c
-diff -ruN gcc-15.1.1/libgcc/configure gcc-15.1.1-kos/libgcc/configure
---- gcc-15.1.1/libgcc/configure 2025-04-18 16:01:37.139067412 -0600
-+++ gcc-15.1.1-kos/libgcc/configure 2025-04-18 16:01:42.914094485 -0600
+diff -ruN gcc-15.2.1/libgcc/configure gcc-15.2.1-kos/libgcc/configure
+--- gcc-15.2.1/libgcc/configure 2025-04-18 16:01:37.139067412 -0600
++++ gcc-15.2.1-kos/libgcc/configure 2025-04-18 16:01:42.914094485 -0600
@@ -5733,6 +5733,7 @@
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
@@ -48,9 +48,9 @@ diff -ruN gcc-15.1.1/libgcc/configure gcc-15.1.1-kos/libgcc/configure
mcf) thread_header=config/i386/gthr-mcf.h ;;
esac
-diff -ruN gcc-15.1.1/libobjc/Makefile.in gcc-15.1.1-kos/libobjc/Makefile.in
---- gcc-15.1.1/libobjc/Makefile.in 2025-04-18 16:01:37.499069099 -0600
-+++ gcc-15.1.1-kos/libobjc/Makefile.in 2025-04-18 16:01:42.915094489 -0600
+diff -ruN gcc-15.2.1/libobjc/Makefile.in gcc-15.2.1-kos/libobjc/Makefile.in
+--- gcc-15.2.1/libobjc/Makefile.in 2025-04-18 16:01:37.499069099 -0600
++++ gcc-15.2.1-kos/libobjc/Makefile.in 2025-04-18 16:01:42.915094489 -0600
@@ -308,14 +308,16 @@
$(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
@@ -81,9 +81,9 @@ diff -ruN gcc-15.1.1/libobjc/Makefile.in gcc-15.1.1-kos/libobjc/Makefile.in
mostlyclean:
-$(LIBTOOL_CLEAN) rm -f libobjc$(libsuffix).la libobjc_gc$(libsuffix).la *.lo
-diff -ruN gcc-15.1.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-15.1.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h
---- gcc-15.1.1/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:37.608069611 -0600
-+++ gcc-15.1.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:42.916094494 -0600
+diff -ruN gcc-15.2.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-15.2.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h
+--- gcc-15.2.1/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:37.608069611 -0600
++++ gcc-15.2.1-kos/libstdc++-v3/config/cpu/sh/atomicity.h 2025-04-18 16:01:42.916094494 -0600
@@ -22,14 +22,40 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
@@ -134,9 +134,9 @@ diff -ruN gcc-15.1.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-15.1.1-kos/libst
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
-diff -ruN gcc-15.1.1/libstdc++-v3/configure gcc-15.1.1-kos/libstdc++-v3/configure
---- gcc-15.1.1/libstdc++-v3/configure 2025-04-18 16:01:37.616069648 -0600
-+++ gcc-15.1.1-kos/libstdc++-v3/configure 2025-04-18 16:01:42.919094508 -0600
+diff -ruN gcc-15.2.1/libstdc++-v3/configure gcc-15.2.1-kos/libstdc++-v3/configure
+--- gcc-15.2.1/libstdc++-v3/configure 2025-04-18 16:01:37.616069648 -0600
++++ gcc-15.2.1-kos/libstdc++-v3/configure 2025-04-18 16:01:42.919094508 -0600
@@ -15974,6 +15974,7 @@
tpf) thread_header=config/s390/gthr-tpf.h ;;
vxworks) thread_header=config/gthr-vxworks.h ;;
diff --git a/utils/dc-chain/profiles/aica/stable.mk b/utils/dc-chain/profiles/aica/stable.mk
index 3a28606e..b6674548 100644
--- a/utils/dc-chain/profiles/aica/stable.mk
+++ b/utils/dc-chain/profiles/aica/stable.mk
@@ -6,7 +6,7 @@ target=arm-eabi
cpu_configure_args=--with-arch=armv4 --with-mode=arm --disable-multilib
# Toolchain versions
-binutils_ver=2.44
+binutils_ver=2.45
gcc_ver=8.5.0
newlib_ver=4.5.0.20241231
gdb_ver=16.3
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 7766a3ae..6aad0c4f 100644
--- a/utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/13.4.1-dev.mk
@@ -13,10 +13,10 @@ target=sh-elf
cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little --with-cpu=$(default_precision)
# Toolchain versions for SH
-binutils_ver=2.44
+binutils_ver=2.45
gcc_ver=13.4.1
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
+gdb_ver=16.3
# Overide SH toolchain download type
gcc_download_type=git
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 6c4803ad..3d3ec9ce 100644
--- a/utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/14.3.1-dev.mk
@@ -13,10 +13,10 @@ target=sh-elf
cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little --with-cpu=$(default_precision)
# Toolchain versions for SH
-binutils_ver=2.44
+binutils_ver=2.45
gcc_ver=14.3.1
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
+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 693c564b..16f45fe7 100644
--- a/utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk
+++ b/utils/dc-chain/profiles/dreamcast/15.0.0-lra.mk
@@ -13,7 +13,7 @@ target=sh-elf
cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little --with-cpu=$(default_precision)
# Toolchain versions for SH
-binutils_ver=2.44
+binutils_ver=2.45
gcc_ver=15.0.0
newlib_ver=4.5.0.20241231
gdb_ver=16.3
diff --git a/utils/dc-chain/profiles/dreamcast/15.1.0.mk b/utils/dc-chain/profiles/dreamcast/15.2.0.mk
similarity index 94%
rename from utils/dc-chain/profiles/dreamcast/15.1.0.mk
rename to utils/dc-chain/profiles/dreamcast/15.2.0.mk
index f3a7c7e4..98e17bb7 100644
--- a/utils/dc-chain/profiles/dreamcast/15.1.0.mk
+++ b/utils/dc-chain/profiles/dreamcast/15.2.0.mk
@@ -6,10 +6,10 @@ target=sh-elf
cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little --with-cpu=$(default_precision)
# Toolchain versions for SH
-binutils_ver=2.44
-gcc_ver=15.1.0
+binutils_ver=2.45
+gcc_ver=15.2.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
+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.1.1-dev.mk b/utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk
similarity index 92%
rename from utils/dc-chain/profiles/dreamcast/15.1.1-dev.mk
rename to utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk
index f71a2bf6..bc20df68 100644
--- a/utils/dc-chain/profiles/dreamcast/15.1.1-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/15.2.1-dev.mk
@@ -4,7 +4,7 @@
###############################################################################
###############################################################################
### THIS CONFIG IS FOR AN EXPERIMENTAL VERSION OF GCC!
-## THERE ARE NO KNOWN ISSUES BUILDING THIS VERSION as of 2025-04-18.
+## THERE ARE NO KNOWN ISSUES BUILDING THIS VERSION as of 2025-08-03.
###############################################################################
###############################################################################
@@ -13,10 +13,10 @@ target=sh-elf
cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little --with-cpu=$(default_precision)
# Toolchain versions for SH
-binutils_ver=2.44
-gcc_ver=15.1.1
+binutils_ver=2.45
+gcc_ver=15.2.1
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
+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 33f03cf8..e612f905 100644
--- a/utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk
+++ b/utils/dc-chain/profiles/dreamcast/16.0.0-dev.mk
@@ -13,10 +13,10 @@ target=sh-elf
cpu_configure_args=--with-multilib-list=$(precision_modes) --with-endian=little --with-cpu=$(default_precision)
# Toolchain versions for SH
-binutils_ver=2.44
+binutils_ver=2.45
gcc_ver=16.0.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
+gdb_ver=16.3
# Overide SH toolchain download type
gcc_download_type=git
diff --git a/utils/dc-chain/profiles/gamecube/stable.mk b/utils/dc-chain/profiles/gamecube/stable.mk
index 0360dd28..9f34b7bc 100644
--- a/utils/dc-chain/profiles/gamecube/stable.mk
+++ b/utils/dc-chain/profiles/gamecube/stable.mk
@@ -7,10 +7,10 @@ cpu_configure_args=--with-endian=big --with-cpu=750 --disable-multilib --disable
newlib_extra_configure_args += --disable-libgloss
# Toolchain versions for PowerPC
-binutils_ver=2.44
-gcc_ver=15.1.0
+binutils_ver=2.45
+gcc_ver=15.2.0
newlib_ver=4.5.0.20241231
-gdb_ver=16.2
+gdb_ver=16.3
# GCC custom dependencies
# Specify here if you want to use custom GMP, MPFR and MPC libraries when
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-07 06:05:41
|
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 5f607420fef4b10ff0df073c1bd37b79eb09a136 (commit)
from 7460bf3085ea260de53c8bfd8ad3c31259c73280 (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 5f607420fef4b10ff0df073c1bd37b79eb09a136
Author: darc <da...@pr...>
Date: Wed Aug 6 18:01:59 2025 -0500
Move arch-specific includes from kos.h to arch/kos.h
-----------------------------------------------------------------------
Summary of changes:
include/kos.h | 52 +---------------------
kernel/arch/dreamcast/include/arch/kos.h | 74 ++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+), 51 deletions(-)
create mode 100644 kernel/arch/dreamcast/include/arch/kos.h
diff --git a/include/kos.h b/include/kos.h
index 05613170..06fa977f 100644
--- a/include/kos.h
+++ b/include/kos.h
@@ -71,57 +71,7 @@ __BEGIN_DECLS
#include <arch/stack.h>
#include <arch/byteorder.h>
#include <arch/rtc.h>
-
-#ifdef _arch_dreamcast
-# include <arch/gdb.h>
-# include <arch/mmu.h>
-# include <arch/memory.h>
-# include <arch/wdt.h>
-
-# include <dc/asic.h>
-# include <dc/biosfont.h>
-# include <dc/cdrom.h>
-# include <dc/fb_console.h>
-# include <dc/flashrom.h>
-# include <dc/fmath.h>
-# include <dc/fs_dcload.h>
-# include <dc/fs_dclsocket.h>
-# include <dc/fs_iso9660.h>
-# include <dc/fs_vmu.h>
-# include <dc/g1ata.h>
-# include <dc/g2bus.h>
-# include <dc/maple.h>
-# include <dc/maple/controller.h>
-# include <dc/maple/dreameye.h>
-# include <dc/maple/keyboard.h>
-# include <dc/maple/mouse.h>
-# include <dc/maple/purupuru.h>
-# include <dc/maple/sip.h>
-# include <dc/maple/vmu.h>
-# include <dc/matrix3d.h>
-# include <dc/matrix.h>
-# include <dc/modem/modem.h>
-# include <dc/net/broadband_adapter.h>
-# include <dc/net/lan_adapter.h>
-# include <dc/perfctr.h>
-# include <dc/pvr.h>
-# include <dc/scif.h>
-# include <dc/sci.h>
-# include <dc/sd.h>
-# include <dc/sound/stream.h>
-# include <dc/sound/sfxmgr.h>
-# include <dc/spu.h>
-# include <dc/sq.h>
-# include <dc/ubc.h>
-# include <dc/vblank.h>
-# include <dc/vec3f.h>
-# include <dc/video.h>
-# include <dc/vmu_fb.h>
-# include <dc/vmu_pkg.h>
-# include <dc/vmufs.h>
-#else /* _arch_dreamcast */
-# error Invalid architecture or no architecture specified
-#endif
+#include <arch/kos.h>
__END_DECLS
diff --git a/kernel/arch/dreamcast/include/arch/kos.h b/kernel/arch/dreamcast/include/arch/kos.h
new file mode 100644
index 00000000..27056363
--- /dev/null
+++ b/kernel/arch/dreamcast/include/arch/kos.h
@@ -0,0 +1,74 @@
+/* KallistiOS ##version##
+
+ arch/dreamcast/include/arch/kos.h
+ Copyright (C) 2025 Eric Fradella
+
+*/
+
+/** \file arch/kos.h
+ \brief Include everything this arch implementation has to offer!
+
+ This is the arch-specific implementation of kos.h, the universal header
+ file that includes all of KallistiOS's functionality.
+
+ This file is already included via the main kos.h, so there's no need
+ to include it yourself.
+
+ \author Eric Fradella
+*/
+
+#ifndef __ARCH_KOS_H
+#define __ARCH_KOS_H
+
+__BEGIN_DECLS
+
+#include <arch/gdb.h>
+#include <arch/mmu.h>
+#include <arch/memory.h>
+#include <arch/wdt.h>
+
+#include <dc/asic.h>
+#include <dc/biosfont.h>
+#include <dc/cdrom.h>
+#include <dc/fb_console.h>
+#include <dc/flashrom.h>
+#include <dc/fmath.h>
+#include <dc/fs_dcload.h>
+#include <dc/fs_dclsocket.h>
+#include <dc/fs_iso9660.h>
+#include <dc/fs_vmu.h>
+#include <dc/g1ata.h>
+#include <dc/g2bus.h>
+#include <dc/maple.h>
+#include <dc/maple/controller.h>
+#include <dc/maple/dreameye.h>
+#include <dc/maple/keyboard.h>
+#include <dc/maple/mouse.h>
+#include <dc/maple/purupuru.h>
+#include <dc/maple/sip.h>
+#include <dc/maple/vmu.h>
+#include <dc/matrix3d.h>
+#include <dc/matrix.h>
+#include <dc/modem/modem.h>
+#include <dc/net/broadband_adapter.h>
+#include <dc/net/lan_adapter.h>
+#include <dc/perfctr.h>
+#include <dc/pvr.h>
+#include <dc/scif.h>
+#include <dc/sci.h>
+#include <dc/sd.h>
+#include <dc/sound/stream.h>
+#include <dc/sound/sfxmgr.h>
+#include <dc/spu.h>
+#include <dc/sq.h>
+#include <dc/ubc.h>
+#include <dc/vblank.h>
+#include <dc/vec3f.h>
+#include <dc/video.h>
+#include <dc/vmu_fb.h>
+#include <dc/vmu_pkg.h>
+#include <dc/vmufs.h>
+
+__END_DECLS
+
+#endif
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-07 06:01:36
|
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 7460bf3085ea260de53c8bfd8ad3c31259c73280 (commit)
from 3c4ee41109de309f7d7765c3eb1c9b48b1f0f1a5 (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 7460bf3085ea260de53c8bfd8ad3c31259c73280
Author: QuzarDC <qu...@co...>
Date: Wed Jul 16 18:37:26 2025 -0400
Check for call to `snd_stream_poll` before `snd_stream_start`
Add a check matching what was done for `snd_stream_fill` that will
assert if called before starting the stream. Without this, it can
trigger an otherwise mysterious divide by zero error.
-----------------------------------------------------------------------
Summary of changes:
kernel/arch/dreamcast/sound/snd_stream.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/arch/dreamcast/sound/snd_stream.c b/kernel/arch/dreamcast/sound/snd_stream.c
index 2b85fcfc..7f6f227a 100644
--- a/kernel/arch/dreamcast/sound/snd_stream.c
+++ b/kernel/arch/dreamcast/sound/snd_stream.c
@@ -802,6 +802,9 @@ int snd_stream_poll(snd_stream_hnd_t hnd) {
return -1;
}
+ /* The stream has been initted but not started, so we don't know stereo/mono. */
+ assert(stream->channels != 0);
+
/* Get channels position */
current_play_pos = g2_read_32(SPU_RAM_UNCACHED_BASE +
AICA_CHANNEL(stream->ch[0]) +
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-06 22: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 3c4ee41109de309f7d7765c3eb1c9b48b1f0f1a5 (commit)
from d4df09a2c3ef4b138840cde3467e66a1ffd9814f (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 3c4ee41109de309f7d7765c3eb1c9b48b1f0f1a5
Author: darc <da...@pr...>
Date: Wed Aug 6 13:35:07 2025 -0500
Define byte order for architecture in Dreamcast's CMake file
-----------------------------------------------------------------------
Summary of changes:
utils/cmake/Platform/dreamcast.cmake | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/utils/cmake/Platform/dreamcast.cmake b/utils/cmake/Platform/dreamcast.cmake
index 530369a7..22bfd4ba 100644
--- a/utils/cmake/Platform/dreamcast.cmake
+++ b/utils/cmake/Platform/dreamcast.cmake
@@ -11,4 +11,8 @@ endif()
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR SH4)
set(CMAKE_SIZEOF_VOID_P 4)
+set(CMAKE_C_BYTE_ORDER LITTLE_ENDIAN)
+set(CMAKE_CXX_BYTE_ORDER LITTLE_ENDIAN)
+set(CMAKE_OBJC_BYTE_ORDER LITTLE_ENDIAN)
+set(CMAKE_OBJCXX_BYTE_ORDER LITTLE_ENDIAN)
set(PLATFORM_DREAMCAST TRUE)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-06 19:17:17
|
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 d4df09a2c3ef4b138840cde3467e66a1ffd9814f (commit)
from 2d510bcb1402d0af81000cb5eb1f6bcf7cb29d59 (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 d4df09a2c3ef4b138840cde3467e66a1ffd9814f
Author: darc <da...@pr...>
Date: Wed Aug 6 12:02:23 2025 -0500
examples: Only build one arch's examples dir based on KOS_ARCH
-----------------------------------------------------------------------
Summary of changes:
examples/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/Makefile b/examples/Makefile
index b64be788..f8d7f9ea 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -9,7 +9,7 @@
# Get a list of the sub-directories that contain a Makefile
get_subdirs=$(foreach each,$(wildcard $(1)/*),$(if $(wildcard $(each)/Makefile),$(each),) $(call get_subdirs,$(each)))
-DIRS := $(call get_subdirs, $(shell pwd))
+DIRS := $(call get_subdirs, $(shell pwd)/$(KOS_ARCH))
.PHONY: all $(DIRS)
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|
|
From: kosmirror <kos...@us...> - 2025-08-06 14:35:35
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "A pseudo Operating System for the Dreamcast.".
The branch, master has been updated
via 2d510bcb1402d0af81000cb5eb1f6bcf7cb29d59 (commit)
via d8e3229c13744def2876206ffa68a7effbb699b1 (commit)
from f68aa6ceeb9a229bb964091fb8786c88d3cd8d68 (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 2d510bcb1402d0af81000cb5eb1f6bcf7cb29d59
Author: QuzarDC <qu...@co...>
Date: Tue Aug 5 16:19:40 2025 -0400
arch: Update to `__pure2` on `kos_get_{banner,license,authors}`
This maps to the gcc function attribute `const` which is stricter
than pure in that it guarantees it will have no observable effect
other than to return a value and the value will not change.
commit d8e3229c13744def2876206ffa68a7effbb699b1
Author: QuzarDC <qu...@co...>
Date: Tue Aug 5 14:50:50 2025 -0400
mutex: Add `__pure` to `mutex_is_locked` prototype.
This got lost when rebasing changes in #992 to take into
account the changes in #1047 .
-----------------------------------------------------------------------
Summary of changes:
include/kos/mutex.h | 2 +-
kernel/arch/dreamcast/include/arch/arch.h | 6 +++---
kernel/arch/dreamcast/kernel/banner.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/kos/mutex.h b/include/kos/mutex.h
index 3fb273c6..c2f467e9 100644
--- a/include/kos/mutex.h
+++ b/include/kos/mutex.h
@@ -211,7 +211,7 @@ int mutex_lock_timed(mutex_t *m, int timeout) __nonnull_all;
\retval 0 If the mutex is not currently locked
\retval 1 If the mutex is currently locked
*/
-int mutex_is_locked(const mutex_t *m) __nonnull_all;
+int __pure mutex_is_locked(const mutex_t *m) __nonnull_all;
/** \brief Attempt to lock a mutex.
diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h
index 972bbd6a..1f9d227c 100644
--- a/kernel/arch/dreamcast/include/arch/arch.h
+++ b/kernel/arch/dreamcast/include/arch/arch.h
@@ -340,7 +340,7 @@ int hardware_sys_mode(int *region);
\return A pointer to the banner string.
*/
-const char * __pure kos_get_banner(void);
+const char * __pure2 kos_get_banner(void);
/** \brief Retrieve the license information for the compiled copy of KOS.
\ingroup attribution
@@ -351,7 +351,7 @@ const char * __pure kos_get_banner(void);
\return A pointer to the license terms.
*/
-const char * __pure kos_get_license(void);
+const char * __pure2 kos_get_license(void);
/** \brief Retrieve a list of authors and the dates of their contributions.
\ingroup attribution
@@ -367,7 +367,7 @@ const char * __pure kos_get_license(void);
\return A pointer to the authors' copyright information.
*/
-const char *__pure kos_get_authors(void);
+const char *__pure2 kos_get_authors(void);
/** \brief Dreamcast specific sleep mode function.
\ingroup arch
diff --git a/kernel/arch/dreamcast/kernel/banner.c b/kernel/arch/dreamcast/kernel/banner.c
index d18a71dd..e7894b73 100644
--- a/kernel/arch/dreamcast/kernel/banner.c
+++ b/kernel/arch/dreamcast/kernel/banner.c
@@ -35,15 +35,15 @@ static const char license[] =
"OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n"
"SUCH DAMAGE.";
-const char * __pure kos_get_banner(void) {
+const char * __pure2 kos_get_banner(void) {
__asm__ __volatile__("nop" : : "r"(license), "r"(authors));
return banner;
}
-const char * __pure kos_get_license(void) {
+const char * __pure2 kos_get_license(void) {
return license;
}
-const char * __pure kos_get_authors(void) {
+const char * __pure2 kos_get_authors(void) {
return authors;
}
hooks/post-receive
--
A pseudo Operating System for the Dreamcast.
|