You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(37) |
Feb
(10) |
Mar
|
Apr
(2) |
May
(17) |
Jun
(1) |
Jul
(14) |
Aug
(14) |
Sep
(4) |
Oct
|
Nov
(14) |
Dec
(4) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(92) |
Dec
(12) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(5) |
May
(3) |
Jun
(15) |
Jul
(3) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
(6) |
Dec
(5) |
2007 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(14) |
Jun
(2) |
Jul
(16) |
Aug
(73) |
Sep
(12) |
Oct
(9) |
Nov
(27) |
Dec
(3) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
(10) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(15) |
Nov
(1) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(22) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(10) |
Mar
(1) |
Apr
(6) |
May
(27) |
Jun
(48) |
Jul
(30) |
Aug
(4) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(7) |
Mar
(6) |
Apr
(18) |
May
(28) |
Jun
(20) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(11) |
Jun
(10) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
(1) |
Mar
(5) |
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2017 |
Jan
(11) |
Feb
|
Mar
(21) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(10) |
Feb
(9) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(20) |
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2023 |
Jan
(10) |
Feb
(7) |
Mar
(29) |
Apr
(31) |
May
(29) |
Jun
(34) |
Jul
(3) |
Aug
(24) |
Sep
(22) |
Oct
(10) |
Nov
(38) |
Dec
(27) |
2024 |
Jan
(15) |
Feb
(8) |
Mar
(4) |
Apr
(20) |
May
(33) |
Jun
(18) |
Jul
(15) |
Aug
(23) |
Sep
(26) |
Oct
(32) |
Nov
(6) |
Dec
(4) |
2025 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(46) |
Jun
(19) |
Jul
(20) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: darcagn <da...@us...> - 2024-05-08 20:20:02
|
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 11b6ae37fd7d38b2379b263f0ae483ed013b2a80 (commit) from bc13e9251c2e650675d73bbf12f3a34bff175cc8 (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 11b6ae37fd7d38b2379b263f0ae483ed013b2a80 Author: darcagn <da...@pr...> Date: Tue May 7 21:54:33 2024 -0600 dc-chain: Improvements in functionality and documentation (#533) * Improve functionality in dc-chain configuration * Refer to toolchain configuration sets as 'profiles' and initial docs updates * Fix Dockerfile for dc-chain updates * Add all GCC languages to init.mk * dc-chain: Disable including arm toolchain by default in download, patch, and build actions * Added support for the Ada language to dc-chain. * Updated changelog.txt for dc-chain. * Fixed issue in gcc-pass2.mk. - Accidentally introduced a bug with adding Ada support, since the variable pass2_languages changed to enabled_languages. * Fixed issues with tabbing for gcc-pass2.mk. * Change make target behavior and add gccrs/rustc profiles * Move default values in toolchain profiles to their own defaults file * Update Dockerfile and its documentation * Rename config.mk to Makefile.cfg, adjust Dockerfile, move unused patches to historical dir * dc-chain: Revise documentation * Adjust profiles/patches for GCC 14.1.0 release; further documentation revisions * Markdownify Changelog * Update CHANGELOG.md * Prettify changelog/contributors * Remove unused kos-patch target * Clean up Dockerfile syntax and add makejobs parameter * Fix issue where arguments to ./configure would duplicate * Updated dc-chain documentation * Some more documentation updates * Last minute fixes before finalizing PR * Fix bug with passing extra configure args * Rename extra_configure_args to cpu_configure_args to clarify intent --------- Co-authored-by: Falco Girgis <gyr...@gm...> ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/.gitignore | 3 +- utils/dc-chain/Makefile | 24 +- utils/dc-chain/Makefile.cfg | 229 +++++++++++++++ utils/dc-chain/README.md | 322 ++++++--------------- utils/dc-chain/config/README.md | 18 -- utils/dc-chain/config/config.mk.10.5.0.sample | 189 ------------ utils/dc-chain/config/config.mk.11.4.0.sample | 189 ------------ utils/dc-chain/config/config.mk.12.3.0.sample | 189 ------------ utils/dc-chain/config/config.mk.13.2.1-dev.sample | 198 ------------- utils/dc-chain/config/config.mk.14.0.1-dev.sample | 206 ------------- utils/dc-chain/config/config.mk.15.0.0-dev.sample | 199 ------------- .../dc-chain/config/config.mk.4.7.4-legacy.sample | 189 ------------ .../dc-chain/config/config.mk.9.3.0-legacy.sample | 189 ------------ utils/dc-chain/config/config.mk.9.5.0-winxp.sample | 189 ------------ utils/dc-chain/config/config.mk.stable.sample | 189 ------------ utils/dc-chain/doc/CHANGELOG.md | 120 ++++++++ utils/dc-chain/doc/CONTRIBUTORS.md | 43 +-- utils/dc-chain/doc/README.md | 16 - utils/dc-chain/doc/alpine.md | 80 +++++ utils/dc-chain/doc/bsd.md | 96 ++++++ utils/dc-chain/doc/bsd/README.md | 127 -------- utils/dc-chain/doc/changelog.txt | 183 ------------ utils/dc-chain/doc/{cygwin/README.md => cygwin.md} | 46 ++- utils/dc-chain/doc/debian.md | 89 ++++++ utils/dc-chain/doc/linux/README.md | 7 - utils/dc-chain/doc/linux/alpine.md | 115 -------- utils/dc-chain/doc/linux/debian.md | 116 -------- utils/dc-chain/doc/macos.md | 125 ++++++++ utils/dc-chain/doc/macos/README.md | 144 --------- utils/dc-chain/doc/mingw/README.md | 9 +- utils/dc-chain/doc/mingw/mingw-w64.md | 69 ++--- utils/dc-chain/doc/mingw/mingw.md | 104 +++---- .../doc/mingw/packages/fixup-sh4-newlib.sh | 10 +- utils/dc-chain/docker/Dockerfile | 14 +- utils/dc-chain/docker/README.md | 36 +-- .../{gcc-14.0.1-kos.diff => gcc-14.1.0-kos.diff} | 48 +-- .../{gcc-15.0.0-kos.diff => gcc-14.1.1-kos.diff} | 48 +-- utils/dc-chain/patches/gcc-rs-fix.diff | 25 ++ .../{gcc-15.0.0-kos.diff => gcc-rs-kos.diff} | 50 ++-- .../{gcc-15.0.0-kos.diff => gcc-rustc-kos.diff} | 68 +++-- .../patches/{ => historical}/gcc-4.7.4-kos.diff | 0 .../patches/{ => historical}/newlib-2.0.0-kos.diff | 0 utils/dc-chain/profiles/profile.10.5.0.mk | 35 +++ utils/dc-chain/profiles/profile.11.4.0.mk | 35 +++ utils/dc-chain/profiles/profile.12.3.0.mk | 35 +++ utils/dc-chain/profiles/profile.13.2.1-dev.mk | 47 +++ utils/dc-chain/profiles/profile.14.1.0.mk | 35 +++ utils/dc-chain/profiles/profile.14.1.1-dev.mk | 47 +++ utils/dc-chain/profiles/profile.15.0.0-dev.mk | 47 +++ utils/dc-chain/profiles/profile.9.3.0-legacy.mk | 35 +++ utils/dc-chain/profiles/profile.9.5.0-winxp.mk | 35 +++ utils/dc-chain/profiles/profile.gccrs-dev.mk | 47 +++ utils/dc-chain/profiles/profile.rustc-dev.mk | 47 +++ utils/dc-chain/profiles/profile.stable.mk | 35 +++ utils/dc-chain/scripts/banner-variables.mk | 2 - utils/dc-chain/scripts/banner.mk | 7 +- utils/dc-chain/scripts/binutils.mk | 24 +- utils/dc-chain/scripts/build.mk | 18 +- utils/dc-chain/scripts/clean.mk | 32 +- utils/dc-chain/scripts/download.mk | 7 +- utils/dc-chain/scripts/gcc-pass1.mk | 9 +- utils/dc-chain/scripts/gcc-pass2.mk | 25 +- utils/dc-chain/scripts/gdb.mk | 13 +- utils/dc-chain/scripts/host-detect.mk | 4 - utils/dc-chain/scripts/init.mk | 94 +++++- utils/dc-chain/scripts/logdir.mk | 4 - utils/dc-chain/scripts/newlib.mk | 10 +- utils/dc-chain/scripts/options.mk | 4 - utils/dc-chain/scripts/patch.mk | 16 +- utils/dc-chain/scripts/phony.mk | 6 +- utils/dc-chain/scripts/profile-defaults.mk | 27 ++ utils/dc-chain/scripts/utils.mk | 3 - utils/dc-chain/scripts/variables.mk | 17 +- 73 files changed, 1797 insertions(+), 3315 deletions(-) create mode 100644 utils/dc-chain/Makefile.cfg delete mode 100644 utils/dc-chain/config/README.md delete mode 100644 utils/dc-chain/config/config.mk.10.5.0.sample delete mode 100644 utils/dc-chain/config/config.mk.11.4.0.sample delete mode 100644 utils/dc-chain/config/config.mk.12.3.0.sample delete mode 100644 utils/dc-chain/config/config.mk.13.2.1-dev.sample delete mode 100644 utils/dc-chain/config/config.mk.14.0.1-dev.sample delete mode 100644 utils/dc-chain/config/config.mk.15.0.0-dev.sample delete mode 100644 utils/dc-chain/config/config.mk.4.7.4-legacy.sample delete mode 100644 utils/dc-chain/config/config.mk.9.3.0-legacy.sample delete mode 100644 utils/dc-chain/config/config.mk.9.5.0-winxp.sample delete mode 100644 utils/dc-chain/config/config.mk.stable.sample create mode 100644 utils/dc-chain/doc/CHANGELOG.md delete mode 100644 utils/dc-chain/doc/README.md create mode 100644 utils/dc-chain/doc/alpine.md create mode 100644 utils/dc-chain/doc/bsd.md delete mode 100644 utils/dc-chain/doc/bsd/README.md delete mode 100644 utils/dc-chain/doc/changelog.txt rename utils/dc-chain/doc/{cygwin/README.md => cygwin.md} (70%) create mode 100644 utils/dc-chain/doc/debian.md delete mode 100644 utils/dc-chain/doc/linux/README.md delete mode 100644 utils/dc-chain/doc/linux/alpine.md delete mode 100644 utils/dc-chain/doc/linux/debian.md create mode 100644 utils/dc-chain/doc/macos.md delete mode 100644 utils/dc-chain/doc/macos/README.md rename utils/dc-chain/patches/{gcc-14.0.1-kos.diff => gcc-14.1.0-kos.diff} (74%) copy utils/dc-chain/patches/{gcc-15.0.0-kos.diff => gcc-14.1.1-kos.diff} (74%) create mode 100644 utils/dc-chain/patches/gcc-rs-fix.diff copy utils/dc-chain/patches/{gcc-15.0.0-kos.diff => gcc-rs-kos.diff} (71%) copy utils/dc-chain/patches/{gcc-15.0.0-kos.diff => gcc-rustc-kos.diff} (64%) rename utils/dc-chain/patches/{ => historical}/gcc-4.7.4-kos.diff (100%) rename utils/dc-chain/patches/{ => historical}/newlib-2.0.0-kos.diff (100%) create mode 100644 utils/dc-chain/profiles/profile.10.5.0.mk create mode 100644 utils/dc-chain/profiles/profile.11.4.0.mk create mode 100644 utils/dc-chain/profiles/profile.12.3.0.mk create mode 100644 utils/dc-chain/profiles/profile.13.2.1-dev.mk create mode 100644 utils/dc-chain/profiles/profile.14.1.0.mk create mode 100644 utils/dc-chain/profiles/profile.14.1.1-dev.mk create mode 100644 utils/dc-chain/profiles/profile.15.0.0-dev.mk create mode 100644 utils/dc-chain/profiles/profile.9.3.0-legacy.mk create mode 100644 utils/dc-chain/profiles/profile.9.5.0-winxp.mk create mode 100644 utils/dc-chain/profiles/profile.gccrs-dev.mk create mode 100644 utils/dc-chain/profiles/profile.rustc-dev.mk create mode 100644 utils/dc-chain/profiles/profile.stable.mk delete mode 100644 utils/dc-chain/scripts/banner-variables.mk create mode 100644 utils/dc-chain/scripts/profile-defaults.mk diff --git a/utils/dc-chain/.gitignore b/utils/dc-chain/.gitignore index 835f45d0..9861c537 100644 --- a/utils/dc-chain/.gitignore +++ b/utils/dc-chain/.gitignore @@ -4,8 +4,7 @@ binutils-* gcc-* newlib-* gdb-* -insight-* build-* *.stamp config.guess -config.mk +Makefile.cfg diff --git a/utils/dc-chain/Makefile b/utils/dc-chain/Makefile index 2d52f9ce..98facf16 100644 --- a/utils/dc-chain/Makefile +++ b/utils/dc-chain/Makefile @@ -1,26 +1,30 @@ # Sega Dreamcast Toolchains Maker (dc-chain) # This file is part of KallistiOS. -# -# Created by Jim Ursetto (2004) -# Initially adapted from Stalin's build script version 0.3. -# -# Please create/edit 'config.mk' to customize your 'dc-chain' setup. +# +# Please edit 'Makefile.cfg' to customize your 'dc-chain' setup. # # Display startup banner -include scripts/banner-variables.mk include scripts/banner.mk # User configuration -config_file=config.mk +config_file=Makefile.cfg ifneq ("$(wildcard $(config_file))","") include $(config_file) else $(error The required $(config_file) file is missing) endif -# Download Functions +# Toolchain profiles +include scripts/profile-defaults.mk +ifneq ("$(wildcard profiles/profile.$(toolchain_profile).mk)","") + include profiles/profile.$(toolchain_profile).mk +else + $(error No configuration found at profiles/profile.$(toolchain_profile).mk) +endif + +# Download functions include scripts/utils.mk # Detect host machine @@ -32,7 +36,9 @@ include scripts/init.mk # Makefile variables include scripts/variables.mk -all: build +default: build gdb + +all: build build-arm gdb # ---- download {{{ diff --git a/utils/dc-chain/Makefile.cfg b/utils/dc-chain/Makefile.cfg new file mode 100644 index 00000000..e9f99c4e --- /dev/null +++ b/utils/dc-chain/Makefile.cfg @@ -0,0 +1,229 @@ +# Sega Dreamcast Toolchains Maker (dc-chain) +# This file is part of KallistiOS. + +######################### +### TOOLCHAIN PROFILE ### +######################### + +# Choose a toolchain profile from the following available options: +# No longer supported upstream: +# - 9.3.0-legacy: Former 'stable' option, based on GCC 9.3.0 and Newlib 3.3.0. +# - 9.5.0-winxp: Most recent versions of tools which run on Windows XP. +# - 10.5.0: Last release in the GCC 10 series, released 2023-07-07. +# Supported upstream: +# - 11.4.0: Latest release in the GCC 11 series, released 2023-05-15. +# - 12.3.0: Latest release in the GCC 12 series, released 2023-05-08. +# - stable: Tested stable; based on GCC 13.2.0, released 2023-07-27. +# - 14.1.0: Latest release in the GCC 14 series, released 2024-05-07. +# Development versions: +# - 13.2.1-dev Bleeding edge GCC 13 series from git. +# - 14.1.1-dev Bleeding edge GCC 14 series from git. +# - 15.0.0-dev Bleeding edge GCC 15 series from git. +# - gccrs-dev: GCC fork for development of the GCCRS Rust compiler. +# - rustc-dev: GCC fork for development of the libgccjit rustc GCC codegen. +# If unsure, select stable. See README.md for more detailed descriptions. +toolchain_profile=stable + +######################## +### DOWNLOAD OPTIONS ### +######################## + +### Download protocol (http|https|ftp) +# Specify the protocol you want to use for downloading package files. +download_protocol=https + +### Force downloader (curl|wget) +# Specify here if you'd prefer to use 'wget' or 'curl'. If neither is specified, +# a web downloader tool will be auto-detected in the following order: cURL, Wget +# You must have either Wget or cURL installed to use dc-chain. +#force_downloader=wget + +### Specify GNU mirror override +# The default mirror for GNU sources is 'ftpmirror.gnu.org' +# This setting overrides the default mirror with a preferred mirror. +#gnu_mirror=mirrors.kernel.org + +##################### +### BUILD OPTIONS ### +##################### + +### SH toolchain install path +# Specify the directory where the SH toolchain will be installed. This setting +# must match the KOS_CC_BASE setting in your KOS "environ.sh" configuration. +sh_toolchain_path=/opt/toolchains/dc/sh-elf + +### ARM toolchain install path +# Specify the directory where the ARM toolchain will be installed. This setting +# must match the DC_ARM_BASE setting in your KOS "environ.sh" configuration. +arm_toolchain_path=/opt/toolchains/dc/arm-eabi + +### Make jobs (n|<empty>) +# Set this value to the number of parallel jobs you want to run with make. +# For fastest toolchain building, set to the number of CPU threads available. +# Using multiple jobs may cause issues in certain environments and may be +# automatically disabled. If you encounter errors building your toolchain, +# reduce the number of jobs to 1 to avoid issues and ease troubleshooting. +makejobs=2 + +### Verbose (1|0) +# Choose whether to actively display compilation messages on the screen. +# Messages are saved to the build log files regardless of this setting. +verbose=1 + +### Erase (1|0) +# Erase build directories as toolchain components are installed to save space. +erase=1 + +### Install toolchain debug symbols (1|0) +# Choose whether to keep the debugging symbols for the toolchain. +# This is only useful if you wish to debug the toolchain itself. +#toolchain_debug=1 + +######################## +### LANGUAGE OPTIONS ### +######################## + +### Enable C++ +# Builds C++ support, including the C++ compiler and its standard library. The +# vast majority of language features are supported, with C++23 and early C++26 +# support included. KallistiOS provides several examples with C++ support, so it +# is enabled by default. Adding C++ support requires extra disk space and +# compilation time, so you may disable it here if you do not plan on using C++. +enable_cpp=1 + +### Enable Objective-C +# Builds Objective-C support. Currently, this builds the Obj-C compiler and +# runtime, but does not build a standard library. The GNUStep Base Library is +# currently in active development for future inclusion in the kos-ports library. +# KallistiOS provides examples with Obj-C support, so it is enabled by default. +enable_objc=1 + +### Enable Objective C++ +# Builds Objective C++ support. This hybrid language allows both C++ and Obj-C +# methods to be called from both contexts. Enabled by default as both the C++ +# and Obj-C languages are already enabled by default. +enable_objcpp=1 + +### Enable D +# Builds D support. This will build the D compiler, but does not build the +# Phobos Runtime Library. D support may only be enabled on POSIX platforms which +# have its external dependencies provided through a host DMD, GDC, or LDC +# compiler installation. +#enable_d=1 + +### Enable Ada +# Builds Ada support. This will build the GNAT Ada compiler and tools but does +# not build the libada runtime library. In order for this build to succeed, the +# host's GCC version must match the target Dreamcast version, plus the same +# version of GNAT and its tools must be preinstalled (and in your path). +#enable_ada=1 + +### Enable Rust +# Builds the work-in-progress GCCRS Rust compiler frontend for GCC. Requires a +# development version of GCC. Use with the gccrs-dev toolchain profile for the +# most recent updates to the GCCRS compiler. This option is not to be confused +# with using this toolchain as a backend for rustc; see libgccjit below. +#enable_rust=1 + +### Enable libgccjit +# Enables the libgccjit embeddable GCC library. This is most commonly enabled to +# allow using this toolchain as a backend for the official rustc compiler. Use +# with the rustc-dev toolchain profile if this is your use case. Enabling this +# option will force the toolchain host code to build as position-independent, +# which will result in slightly slower compilation times for this toolchain. +#enable_libgccjit=1 + +################### +### GCC OPTIONS ### +################### + +### Floating point precision support (m4-single-only|m4-single|m4) +# Build support for various SH4 floating-point operation ABIs. KallistiOS only +# officially supports single-precision-only mode (m4-single-only); however, +# experimental support for single-precision-default mode (m4-single) has been +# added to allow for the use of full 64-bit doubles. You may also include +# double-precision-default (m4) which is untested and unsupported, or you may +# choose to specify only m4-single-only to save disk space. +precision_modes=m4-single-only,m4-single + +### Default floating point mode (m4|m4-single|m4-single-only) +# Choose the default floating point precision ABI used when GCC is invoked. This +# may be overridden by passing -m4-single-only, -m4-single, or -m4 to GCC. +# KOS currently only officially supports m4-single-only, so it is the default. +default_precision=m4-single-only + +### GCC threading model (single|kos) +# KallistiOS patches to GCC provide a 'kos' thread model, which should be used. +# If you want to disable threading support for C++, Objective-C, and so forth, +# you can set this option to 'single'. +thread_model=kos + +### Automatic patching for KallistiOS (1|0) +# Uncomment this option if you want to disable applying KallistiOS patches to +# toolchain source files before building. This will disable usage of the 'kos' +# thread model. Only do this if you understand what you are doing. +#use_kos_patches=0 + +### Disable GCC Native Language Support (1|0) +# By default, NLS allows GCC to output diagnostics in non-English languages. +# Uncomment this option to disable NLS and force GCC to output in English. +#disable_nls=1 + +###################### +### NEWLIB OPTIONS ### +###################### + +### Automatic patching for Newlib (1|0) +# Uncomment this option if you want to disable the automatic patching of Newlib +# needed by KallistiOS. This will keep the generated toolchain completely raw. +# This will also disable the 'kos' thread model. Only do this if you understand +# what you are doing. +#auto_fixup_sh4_newlib=0 + +### C99 format specifier support (1|0) +# Define this to build Newlib with additional support for the C99 format +# specifiers, used by printf and friends. These include support for size_t, +# ptrdiff_t, intmax_t, and sized integral types. +newlib_c99_formats=1 + +### Multibyte character set support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + +### iconv() character encoding conversions support (encoding list) +# Define a list here to enable support for the iconv() function and <iconv.h> +# header file. The given comma separated list defines for which encoding types +# to include bidirectional conversion support. For the full list of available +# encodings, see the Newlib configuration documentation. +#newlib_iconv_encodings=us_ascii,utf8,utf16,ucs_2_internal,ucs_4_internal + +### Optimize Newlib for space (1|0) +# Uncomment this option to optimize for space when building Newlib. This will +# build Newlib with compiler flags which favor smaller code sizes over faster +# performance. +#newlib_opt_space=1 + +####################### +### WINDOWS OPTIONS ### +####################### + +### MinGW/MSYS +# Standalone binaries (1|0) +# Uncomment this option if you want static binaries that are standalone and +# require no dependencies. When this option is used, binaries can be run outside +# the MinGW/MSYS environment. This is NOT recommended; only do this if you know +# what you are doing. +#standalone_binary=1 + +### Force installation of BFD for SH (1|0) +# Uncomment this option if you want to force installation of 'libbfd' for the SH +# toolchain. This is required for MinGW/MSYS and can't be disabled in this +# scenario. This option is here mainly if you want to force the installation of +# 'libbfd' under other environments, but this won't be necessary in most cases, +# as 'libelf' is used almost everywhere. Please note, 'libbfd' is not portable +# if you built it on another environment. Only use this flag if you understand +# what you are doing. +#sh_force_libbfd_installation=1 diff --git a/utils/dc-chain/README.md b/utils/dc-chain/README.md index 483d3b5c..bae59505 100644 --- a/utils/dc-chain/README.md +++ b/utils/dc-chain/README.md @@ -2,20 +2,25 @@ The **Sega Dreamcast Toolchains Maker** (`dc-chain`) is a utility to assist in building the toolchains and development environment needed for **Sega Dreamcast** -programming. Initially adapted from *Stalin*'s build script, it was first -released by *Jim Ursetto* back in 2004, and is now included as part of -**KallistiOS** (**KOS**). +programming. + +This script was adapted from earlier `dc-chain` scripts created by James +Sumners and Jim Ursetto in the early days of the Dreamcast homebrew scene, but +the utility has been [largely expanded and reworked](doc/changelog.txt) by many +[contributors](doc/CONTRIBUTORS.md) since then, and it is now included as part +of **KallistiOS** (**KOS**). This utility is capable of building two toolchains for **Dreamcast** development: - The `sh-elf` toolchain, the primary cross-compiler toolchain targeting the - main CPU of the Dreamcast, the **Hitachi SuperH (SH4) CPU** . + main CPU of the Dreamcast, the **Hitachi SuperH (SH4) CPU**. - The `arm-eabi` toolchain, used only for the **Yamaha Super Intelligent Sound Processor** (**AICA**). This processor is based on an **ARM7** core. The main `sh-elf` toolchain is required, but KallistiOS includes a precompiled AICA sound driver, so building the `arm-eabi` toolchain is only necessary when -altering the sound driver or writing custom AICA code. +altering the sound driver or writing custom AICA code; therefore, it is not +built by default. The `sh-elf` toolchain by default is built to target KallistiOS specifically, however options are included to build a "raw" toolchain to allow targeting other @@ -36,14 +41,27 @@ the main `sh-elf` toolchain. ## Getting started -Before you start, please browse the `doc` directory and check for full -instructions for building the toolchains for your environment. +Before starting, please check the following pages for special instructions +specific to your operating system or computing platform. These special +instructions should be limited, though, as much diligence was taken to add +multiplatform functionality to be compatible in all modern environments. + +Tested environments with specific instructions are as follows: + +- **GNU/Linux** + - **[Alpine Linux 3.19](doc/alpine.md)** + - **[Debian 12.5](doc/debian.md)** + +- **[macOS](doc/macos.md)** (High Sierra 10.13, Mojave 10.14, + Catalina 10.15, Sonoma 14.2.1, etc.) + +- **[BSD](doc/bsd.md)** (FreeBSD 14.0) -A big effort was put into simplifying the building process as much as possible -for all modern environments, including **Linux**, **FreeBSD**, **macOS** and -**Windows** (via **Windows Subsystem for Linux**, **Cygwin**, **MinGW-w64/MSYS2** -or **MinGW/MSYS**). Many conditional instructions have been diligently added to -the script to allow it to seamlessly function in many environments out of the box. +- **Windows** + - **Windows Subsystem for Linux (WSL)**: See standard Linux instructions. + - **[Cygwin](doc/cygwin.md)** + - **[MinGW/MSYS](doc/mingw/mingw.md)** + - **[MinGW-w64/MSYS2](doc/mingw/mingw-w64.md)** ### `dc-chain` utility installation `dc-chain` is packaged with KallistiOS, where it can be found within the @@ -59,229 +77,76 @@ regular `gcc` and related tools) in order to build the cross compiler. The *may* work, but are not guaranteed to function properly. Several dependencies such as `wget`, `gettext`, `texinfo`, `gmp`, `mpfr`, -`libmpc`, etc. are required to build the toolchain. The `doc` directory contains -useful platform-specific instructions for installing dependencies. +`libmpc`, etc. are required to build the toolchain. Check the platform-specific +instructions mentioned above for installing dependencies on your system. ## Configuration -Before running `dc-chain`, you will need to set up the `config.mk` file containing -settings for building the toolchain(s). Most users can simply use the the default -`config.mk.stable.sample` template, which contains a stable default configuration -to make this easy for you. Additional configuration templates for alternative -settings are available in the `config` directory; see `config/README.md` for more -details. Most users can skip configuration without altering any options whatsoever. -Simply copy the `config.mk.stable.sample` file from the `config` directory to use ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-05-05 18:14:09
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via bc13e9251c2e650675d73bbf12f3a34bff175cc8 (commit) from bdaec39f4a286177d0b8e432da5a0e7a127d1732 (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 bc13e9251c2e650675d73bbf12f3a34bff175cc8 Author: Tchan0 <617...@us...> Date: Sun May 5 20:13:31 2024 +0200 fix fb_console's max height (#548) Authored-by: T_chan <> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/util/fb_console.c | 2 +- kernel/arch/dreamcast/util/fb_console_naomi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/arch/dreamcast/util/fb_console.c b/kernel/arch/dreamcast/util/fb_console.c index 05121225..dd8bc4bd 100644 --- a/kernel/arch/dreamcast/util/fb_console.c +++ b/kernel/arch/dreamcast/util/fb_console.c @@ -131,7 +131,7 @@ void dbgio_fb_set_target(uint16 *t, int w, int h, int borderx, int bordery) { min_x = borderx; min_y = bordery; max_x = fb_w - borderx; - max_y = fb_w - bordery; + max_y = fb_h - bordery; cur_x = min_x; cur_y = min_y; } diff --git a/kernel/arch/dreamcast/util/fb_console_naomi.c b/kernel/arch/dreamcast/util/fb_console_naomi.c index dacf67b9..c221b44b 100644 --- a/kernel/arch/dreamcast/util/fb_console_naomi.c +++ b/kernel/arch/dreamcast/util/fb_console_naomi.c @@ -133,7 +133,7 @@ void dbgio_fb_set_target(uint16 *t, int w, int h, int borderx, int bordery) { min_x = borderx; min_y = bordery; max_x = fb_w - borderx; - max_y = fb_w - bordery; + max_y = fb_h - bordery; cur_x = min_x; cur_y = min_y; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-05-05 08:23:56
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via bdaec39f4a286177d0b8e432da5a0e7a127d1732 (commit) via 6087531a0e879d5bc9461f1baab74a6fa8217257 (commit) from dce7ef2a8f8c36a4487e1688daa62da847c4ef42 (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 bdaec39f4a286177d0b8e432da5a0e7a127d1732 Merge: dce7ef2a 6087531a Author: Luke Benstead <ka...@gm...> Date: Sun May 5 09:23:14 2024 +0100 Merge pull request #547 from KallistiOS/fsantizier_buildfix Forgot a closing brace in previous commit! commit 6087531a0e879d5bc9461f1baab74a6fa8217257 Author: Falco Girgis <gyr...@gm...> Date: Sun May 5 03:18:24 2024 -0500 Forgot a closing brace in previous commit! ----------------------------------------------------------------------- Summary of changes: kernel/fs/fs_random.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/fs/fs_random.c b/kernel/fs/fs_random.c index 1008c2c3..6971ce3f 100644 --- a/kernel/fs/fs_random.c +++ b/kernel/fs/fs_random.c @@ -56,6 +56,7 @@ static rnd_fh_t *rnd_open_file(vfs_handler_t *vfs, const char *fn, int mode) { if((mode & O_MODE_MASK) != O_RDONLY) { errno = EPERM; return NULL; + } /* Malloc a new fh struct */ fd = malloc(sizeof(rnd_fh_t)); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-05-05 07:29:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via dce7ef2a8f8c36a4487e1688daa62da847c4ef42 (commit) from dbdc05cf9f64a32b679285c2bb5bb196546407d7 (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 dce7ef2a8f8c36a4487e1688daa62da847c4ef42 Author: Donald Haase <qu...@ya...> Date: Sun May 5 03:28:59 2024 -0400 Fanalyzer ffixes (#544) * Seal memory leak * Zero out initial dir data to prevent uninitialized reads * Prevent memsetting NULL on OOM * Check and report OOM, clean up RO check for random open --------- Co-authored-by: QuzarDC <qu...@co...> ----------------------------------------------------------------------- Summary of changes: addons/libppp/ppp.c | 2 ++ kernel/arch/dreamcast/fs/vmufs.c | 3 +++ kernel/arch/dreamcast/sound/snd_mem.c | 14 ++++++++++++++ kernel/fs/fs_null.c | 4 ++++ kernel/fs/fs_random.c | 18 +++++++++--------- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/addons/libppp/ppp.c b/addons/libppp/ppp.c index abaf354a..d5de66ad 100644 --- a/addons/libppp/ppp.c +++ b/addons/libppp/ppp.c @@ -460,6 +460,8 @@ int ppp_set_login(const char *username, const char *password) { if(password) { if(!(pw = (char *)malloc(strlen(password) + 1))) { + if(username) + free(un); mutex_unlock(&mutex); return -1; } diff --git a/kernel/arch/dreamcast/fs/vmufs.c b/kernel/arch/dreamcast/fs/vmufs.c index bafaafe9..c40fc658 100644 --- a/kernel/arch/dreamcast/fs/vmufs.c +++ b/kernel/arch/dreamcast/fs/vmufs.c @@ -527,6 +527,9 @@ static int vmufs_setup(maple_device_t * dev, vmu_root_t * root, vmu_dir_t ** dir goto dead; } + /* Ensure that the dir is 0'd to avoid possible uninitialized reads */ + memset(*dir, 0, sizeof(*dirsize)); + /* Read it */ if(vmufs_dir_read(dev, root, *dir) < 0) { free(*dir); diff --git a/kernel/arch/dreamcast/sound/snd_mem.c b/kernel/arch/dreamcast/sound/snd_mem.c index c2638154..ee85418b 100644 --- a/kernel/arch/dreamcast/sound/snd_mem.c +++ b/kernel/arch/dreamcast/sound/snd_mem.c @@ -89,6 +89,13 @@ int snd_mem_init(uint32 reserve) { TAILQ_INIT(&pool); blk = (snd_block_t *)malloc(sizeof(snd_block_t)); + + if(!blk) { + spinlock_unlock(&snd_mem_mutex); + errno = ENOMEM; + return -1; + } + memset(blk, 0, sizeof(snd_block_t)); blk->addr = reserve; blk->size = 2 * 1024 * 1024 - reserve; @@ -190,6 +197,13 @@ uint32 snd_mem_malloc(size_t size) { /* Nope: break it up into two chunks */ e = (snd_block_t*)malloc(sizeof(snd_block_t)); + + if(e == NULL) { + dbglog(DBG_ERROR, "snd_mem_malloc: not enough main memory to alloc(%d)\n", size); + spinlock_unlock(&snd_mem_mutex); + return 0; + } + memset(e, 0, sizeof(snd_block_t)); e->addr = best->addr + size; e->size = best->size - size; diff --git a/kernel/fs/fs_null.c b/kernel/fs/fs_null.c index d41f536f..7fbea93e 100644 --- a/kernel/fs/fs_null.c +++ b/kernel/fs/fs_null.c @@ -38,6 +38,10 @@ static null_fh_t *null_open_file(vfs_handler_t *vfs, const char *fn, int mode) { /* Malloc a new fh struct */ fd = malloc(sizeof(null_fh_t)); + if(!fd) { + errno = ENOMEM; + return NULL; + } /* Fill in the filehandle struct */ fd->mode = mode; diff --git a/kernel/fs/fs_random.c b/kernel/fs/fs_random.c index 28749a35..1008c2c3 100644 --- a/kernel/fs/fs_random.c +++ b/kernel/fs/fs_random.c @@ -51,22 +51,22 @@ static rnd_fh_t *rnd_open_file(vfs_handler_t *vfs, const char *fn, int mode) { (void) fn; rnd_fh_t * fd; /* file descriptor */ - int realmode; + + /* We only allow reading, not writing */ + if((mode & O_MODE_MASK) != O_RDONLY) { + errno = EPERM; + return NULL; /* Malloc a new fh struct */ fd = malloc(sizeof(rnd_fh_t)); + if(!fd) { + errno = ENOMEM; + return NULL; + } /* Fill in the filehandle struct */ fd->mode = mode; - realmode = mode & O_MODE_MASK; - - /* We only allow reading, not writing */ - if(realmode != O_RDONLY) { - free(fd); - return NULL; - } - return fd; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-05-04 03:13:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via dbdc05cf9f64a32b679285c2bb5bb196546407d7 (commit) from f329209068f1aadee9c53c694880633ab236df4d (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 dbdc05cf9f64a32b679285c2bb5bb196546407d7 Author: Paul Cercueil <pa...@cr...> Date: Sat May 4 05:12:36 2024 +0200 dc: Fix __fipr() and __fipr_magnitude_sqr() macros (#540) They were not returning the correct register when building with -m4-single. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/dc/fmath_base.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/arch/dreamcast/include/dc/fmath_base.h b/kernel/arch/dreamcast/include/dc/fmath_base.h index a08501dc..626d97ee 100644 --- a/kernel/arch/dreamcast/include/dc/fmath_base.h +++ b/kernel/arch/dreamcast/include/dc/fmath_base.h @@ -144,11 +144,11 @@ __BEGIN_DECLS register float __d __asm__(KOS_FPARG(7)) = (d); \ __asm__ __volatile__( \ "fipr fv8,fv4" \ - : "+f" (__z) \ + : "+f" (KOS_SH4_SINGLE_ONLY ? __w : __z) \ : "f" (__x), "f" (__y), "f" (__z), "f" (__w), \ "f" (__a), "f" (__b), "f" (__c), "f" (__d) \ ); \ - __z; }) + KOS_SH4_SINGLE_ONLY ? __w : __z; }) /* Floating point inner product w/self (square of vector magnitude) */ #define __fipr_magnitude_sqr(x, y, z, w) ({ \ @@ -158,10 +158,10 @@ __BEGIN_DECLS register float __w __asm__(KOS_FPARG(3)) = (w); \ __asm__ __volatile__( \ "fipr fv4,fv4" \ - : "+f" (__z) \ + : "+f" (KOS_SH4_SINGLE_ONLY ? __w : __z) \ : "f" (__x), "f" (__y), "f" (__z), "f" (__w) \ ); \ - __z; }) + KOS_SH4_SINGLE_ONLY ? __w : __z; }) /** \endcond */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-04-30 23:15:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via f329209068f1aadee9c53c694880633ab236df4d (commit) via a326c0119b2c6baf92083bf749a759b094845730 (commit) via 2d09b5a1fc147f1f113ca0f05b71ffe0ecfcdb9e (commit) from f798f6cda5796de80eb0fdf2eebf84ba596ded8b (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 f329209068f1aadee9c53c694880633ab236df4d Author: Falco Girgis <gyr...@gm...> Date: Tue Apr 30 18:13:59 2024 -0500 Add Newlib Configuration Parameter for Enabling iconv() (#532) * Added changelog entry. * iconv Newlib configuration parameter added. commit a326c0119b2c6baf92083bf749a759b094845730 Merge: f798f6cd 2d09b5a1 Author: Lawrence Sebald <ljs...@us...> Date: Tue Apr 30 10:39:14 2024 -0400 Merge pull request #528 from pcercuei/bin-rule Makefile.rules: Add rule to create binary executables commit 2d09b5a1fc147f1f113ca0f05b71ffe0ecfcdb9e Author: Paul Cercueil <pa...@cr...> Date: Thu Apr 25 20:10:00 2024 +0200 Makefile.rules: Add rule to create binary executables Add a rule to create (unscrambled) .bin files from .elf files. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: Makefile.rules | 3 +++ utils/dc-chain/config/config.mk.14.0.1-dev.sample | 7 +++++++ utils/dc-chain/doc/changelog.txt | 2 ++ utils/dc-chain/scripts/init.mk | 7 +++++++ 4 files changed, 19 insertions(+) diff --git a/Makefile.rules b/Makefile.rules index e670cda5..aafeb9bf 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -51,6 +51,9 @@ endif %.o: %.S kos-cc -c $< -o $@ +%.bin: %.elf + kos-objcopy -O binary $< $@ + subdirs: $(patsubst %, _dir_%, $(SUBDIRS)) $(patsubst %, _dir_%, $(SUBDIRS)): diff --git a/utils/dc-chain/config/config.mk.14.0.1-dev.sample b/utils/dc-chain/config/config.mk.14.0.1-dev.sample index 2ad0b606..74ae23b8 100644 --- a/utils/dc-chain/config/config.mk.14.0.1-dev.sample +++ b/utils/dc-chain/config/config.mk.14.0.1-dev.sample @@ -170,6 +170,13 @@ newlib_c99_formats=1 # characters for the printf and scanf family of routines. #newlib_multibyte=1 +# iconv - Character Encoding Conversions Support (encoding list) +# Define this to enable support for the iconv() function and <iconv.h> header +# file. The given comma separated list tells Newlib which encoding types to +# include converters for going to and from. For the full list of available +# encodings, see the Newlib configuration documentation. +#newlib_iconv_encodings=us_ascii,utf8,utf16,ucs_2_internal,ucs_4_internal + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/doc/changelog.txt b/utils/dc-chain/doc/changelog.txt index 3d86f1f4..00b77059 100644 --- a/utils/dc-chain/doc/changelog.txt +++ b/utils/dc-chain/doc/changelog.txt @@ -1,3 +1,5 @@ +2024-04-30: Added config option for enabling iconv library support in Newlib. + (Falco Girgis) 2024-04-21: Added D to list of supported languages, added m4-single as a default precision mode, added --disable-libphobos to gcc-pass2 (Falco Girgis) diff --git a/utils/dc-chain/scripts/init.mk b/utils/dc-chain/scripts/init.mk index 438f75d1..004165ea 100644 --- a/utils/dc-chain/scripts/init.mk +++ b/utils/dc-chain/scripts/init.mk @@ -152,6 +152,13 @@ ifdef newlib_multibyte endif endif +ifdef newlib_iconv_encodings + ifneq (0,$(newlib_iconv_encodings)) + newlib_extra_configure_args += --enable-newlib-iconv + newlib_extra_configure_args += --enable-newlib-iconv-encodings=$(newlib_iconv_encodings) + endif +endif + ifdef disable_nls ifneq (0,$(disable_nls)) extra_configure_args += --disable-nls hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-04-30 12:34:42
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via f798f6cda5796de80eb0fdf2eebf84ba596ded8b (commit) from 9d93eadb528671d3f11fe84114aff0b5874754f5 (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 f798f6cda5796de80eb0fdf2eebf84ba596ded8b Author: Falco Girgis <gyr...@gm...> Date: Tue Apr 30 07:32:52 2024 -0500 Minor Floating-Point Precision Fixes (#504) * Minor floating point precision fixes. vec3f.h - explicitly truncated two double-precision fp constants to single-precision floats ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/dc/vec3f.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/arch/dreamcast/include/dc/vec3f.h b/kernel/arch/dreamcast/include/dc/vec3f.h index a1f9c250..51706e00 100644 --- a/kernel/arch/dreamcast/include/dc/vec3f.h +++ b/kernel/arch/dreamcast/include/dc/vec3f.h @@ -33,8 +33,8 @@ typedef struct vec3f { } vec3f_t; /** \cond */ -#define R_DEG 182.04444443623349541909523793743 -#define R_RAD 10430.37835 +#define R_DEG 182.04444443623349541909523793743f +#define R_RAD 10430.37835f /* \endcond */ /** \brief Macro to return the scalar dot product of two 3d vectors. hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-04-29 17:47:21
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 9d93eadb528671d3f11fe84114aff0b5874754f5 (commit) via e2df806c4d9074544c1b37782988eb606d6e100c (commit) via d21b171a48930baf68ba5da6fb53d32e7d1a6feb (commit) via 8955282afe6ee15248175cd5acc44869f71a1bdf (commit) from a69d61cdf816bd520b873698ba26832dce49d496 (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 9d93eadb528671d3f11fe84114aff0b5874754f5 Author: darcagn <da...@pr...> Date: Mon Apr 29 11:39:23 2024 -0600 Fix 'parameter name omitted' errors on older compilers (#531) commit e2df806c4d9074544c1b37782988eb606d6e100c Author: Donald Haase <qu...@ya...> Date: Mon Apr 29 13:37:37 2024 -0400 Patch newlib headers to expose lstat (#530) * Patch newlib headers to expose lstat, which we already support * Add patches for exposing lstat in Newlib 2.0.0 and 3.3.0 * Fix unexpected end of line error in Newlib 4.4.0 patch --------- Co-authored-by: QuzarDC <qu...@co...> Co-authored-by: darcagn <da...@pr...> commit d21b171a48930baf68ba5da6fb53d32e7d1a6feb Author: darcagn <da...@pr...> Date: Sun Apr 28 02:31:13 2024 -0600 Update GCC configurations and patches for new separate GCC 15 and 14 branches, D support, and building m4-single support (#526) commit 8955282afe6ee15248175cd5acc44869f71a1bdf Author: Paul Cercueil <pa...@cr...> Date: Sat Apr 27 22:10:38 2024 +0200 Worker threads (#505) * thread: Add worker threads Worker threads are threads that are associated to a given work function. When notified (through thd_worker_notify()), the worker thread will call its work function. This is useful for implementing asynchronous function calls. It is especially useful to implement threaded interrupt handlers. Signed-off-by: Paul Cercueil <pa...@cr...> * asic: Use worker thread to implement threaded interrupt handlers Most of the threaded interrupt handler code was duplicated vs. the worker thread code. Update the ASIC code to now use the worker thread API instead. Signed-off-by: Paul Cercueil <pa...@cr...> * thread: Add optional jobs API for use with worker threads Using this API, the program can enqueue specific jobs to the worker threads, and dequeue them in their respective work function, in a FIFO fashion. Signed-off-by: Paul Cercueil <pa...@cr...> * thread: Add explicit constructor for worker threads Add thd_worker_create_ex() which takes an extra parameter that can be used to specify the thread's attributes. Signed-off-by: Paul Cercueil <pa...@cr...> * Update include/kos/worker_thread.h --------- Signed-off-by: Paul Cercueil <pa...@cr...> Co-authored-by: Falco Girgis <gyr...@gm...> Co-authored-by: darcagn <da...@pr...> ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + include/kos/worker_thread.h | 156 +++++++++++++++++++++ kernel/arch/dreamcast/hardware/asic.c | 50 ++----- kernel/arch/dreamcast/hardware/maple/controller.c | 4 +- kernel/arch/dreamcast/hardware/maple/dreameye.c | 16 ++- kernel/arch/dreamcast/hardware/maple/keyboard.c | 4 +- kernel/arch/dreamcast/hardware/maple/mouse.c | 4 +- kernel/arch/dreamcast/hardware/maple/purupuru.c | 4 +- kernel/arch/dreamcast/hardware/maple/sip.c | 12 +- kernel/arch/dreamcast/hardware/maple/vmu.c | 20 ++- kernel/thread/Makefile | 1 + kernel/thread/worker.c | 123 ++++++++++++++++ utils/dc-chain/config/README.md | 1 + utils/dc-chain/config/config.mk.10.5.0.sample | 28 ++-- utils/dc-chain/config/config.mk.11.4.0.sample | 28 ++-- utils/dc-chain/config/config.mk.12.3.0.sample | 28 ++-- utils/dc-chain/config/config.mk.13.2.1-dev.sample | 3 +- utils/dc-chain/config/config.mk.14.0.1-dev.sample | 36 ++--- ....2.1-dev.sample => config.mk.15.0.0-dev.sample} | 12 +- .../dc-chain/config/config.mk.4.7.4-legacy.sample | 28 ++-- .../dc-chain/config/config.mk.9.3.0-legacy.sample | 28 ++-- utils/dc-chain/config/config.mk.9.5.0-winxp.sample | 28 ++-- utils/dc-chain/config/config.mk.stable.sample | 28 ++-- utils/dc-chain/patches/gcc-13.2.1-kos.diff | 4 +- utils/dc-chain/patches/gcc-14.0.1-kos.diff | 59 +------- .../{gcc-13.1.0-kos.diff => gcc-15.0.0-kos.diff} | 56 ++++---- utils/dc-chain/patches/newlib-2.0.0-kos.diff | 13 ++ utils/dc-chain/patches/newlib-3.3.0-kos.diff | 13 ++ .../patches/newlib-4.3.0.20230120-kos.diff | 13 ++ .../patches/newlib-4.4.0.20231231-kos.diff | 15 ++ 30 files changed, 560 insertions(+), 256 deletions(-) create mode 100644 include/kos/worker_thread.h create mode 100644 kernel/thread/worker.c copy utils/dc-chain/config/{config.mk.13.2.1-dev.sample => config.mk.15.0.0-dev.sample} (96%) copy utils/dc-chain/patches/{gcc-13.1.0-kos.diff => gcc-15.0.0-kos.diff} (68%) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 7a1706e0..cb37cfe0 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -222,6 +222,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Add support for French AZERTY keyboards [PC] - DC Increased the resolution of pvr_stats_t from milli to nanoseconds [FG] - *** Added support for modifying scheduler frequency at runtime [FG] +- *** Add support for worker threads [PC] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/include/kos/worker_thread.h b/include/kos/worker_thread.h new file mode 100644 index 00000000..2ec940e8 --- /dev/null +++ b/include/kos/worker_thread.h @@ -0,0 +1,156 @@ +/* KallistiOS ##version## + + include/kos/worker_thread.h + Copyright (C) 2024 Paul Cercueil +*/ + +/** \file kos/worker_thread.h + \brief Threaded worker support. + \ingroup kthreads + + This file contains the threaded worker API. Threaded workers are threads + that are idle most of the time, until they are notified that there is work + pending; in which case they will call their associated work function. + + The work function can then process any number of tasks, until it clears out + all of its tasks or decides that it worked enough; in which case the + function can return, and will re-start the next time it is notified, or if + it was notified while it was running. + + An optional API is also present, which provides a FIFO for jobs to be + processed by the threaded worker. This is useful when jobs have to be + processed in sequence. + + \author Paul Cercueil + + \see kos/thread.h +*/ + +#ifndef __KOS_WORKER_THREAD_H +#define __KOS_WORKER_THREAD_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <kos/thread.h> +#include <sys/queue.h> + +struct kthread_worker; + +/** \brief Structure describing one worker thread. + + \headerfile kos/thread.h +*/ +typedef struct kthread_worker kthread_worker_t; + +/** \brief Structure describing one job for the worker. */ +typedef struct kthread_job { + /** \brief List handle. */ + STAILQ_ENTRY(kthread_job) entry; + + /** \brief User pointer to the work data. */ + void *data; +} kthread_job_t; + +/** \brief Create a new worker thread with the specific set of attributes. + \relatesalso kthread_worker_t + + This function will create a thread with the specified attributes that will + call the given routine with the given param pointer when notified. + The thread will only stop when thd_worker_destroy() is called. + + \param attr A set of thread attributes for the created thread. + Passing NULL will initialize all attributes to their + default values. + \param routine The function to call in the worker thread. + \param data A parameter to pass to the function called. + + \return The new worker thread on success, NULL on failure. + + \sa thd_worker_destroy, thd_worker_wakeup +*/ +kthread_worker_t *thd_worker_create_ex(const kthread_attr_t *attr, + void (*routine)(void *), void *data); + +/** \brief Create a new worker thread. + \relatesalso kthread_worker_t + + This function will create a thread with the default attributes that will + call the given routine with the given param pointer when notified. + The thread will only stop when thd_worker_destroy() is called. + + \param routine The function to call in the worker thread. + \param data A parameter to pass to the function called. + + \return The new worker thread on success, NULL on failure. + + \sa thd_worker_destroy, thd_worker_wakeup +*/ +static inline kthread_worker_t * +thd_worker_create(void (*routine)(void *), void *data) { + return thd_worker_create_ex(NULL, routine, data); +} + +/** \brief Stop and destroy a worker thread. + \relatesalso kthread_worker_t + + This function will stop the worker thread and free its memory. + + \param thd The worker thread to destroy. + + \sa thd_worker_create, thd_worker_wakeup +*/ +void thd_worker_destroy(kthread_worker_t *thd); + +/** \brief Wake up a worker thread. + \relatesalso kthread_worker_t + + This function will wake up the worker thread, causing it to call its + corresponding work function. Usually, this should be called after a new + job has been added with thd_worker_add_job(). + + \param thd The worker thread to wake up. + + \sa thd_worker_create, thd_worker_destroy, thd_worker_add_job +*/ +void thd_worker_wakeup(kthread_worker_t *thd); + +/** \brief Get a handle to the underlying thread. + \relatesalso kthread_worker_t + + \param thd The worker thread whose handle should be returned. + + \return A handle to the underlying thread. +*/ +kthread_t *thd_worker_get_thread(kthread_worker_t *thd); + +/** \brief Add a new job to the worker thread. + \relatesalso kthread_worker_t + + This function will append the job to the worker thread's to-do queue. + Note that it is the responsability of the work function (the one passed to + thd_worker_create()) to dequeue and process the jobs with + thd_worker_dequeue_job(). Also, this function won't automatically notify the + worker thread - you still need to call thd_worker_wakeup(). + + \param thd The worker thread to add a job to. + \param job The new job to give to the worker thread. +*/ +void thd_worker_add_job(kthread_worker_t *thd, kthread_job_t *job); + +/** \brief Dequeue one job from the worker thread's to-do queue. + \relatesalso kthread_worker_t + + Use this function to dequeue one job from the worker thread, that has been + previously queued using thd_worker_add_job(). This function is typically + used inside the work function registered with thd_worker_create(). + + \param thd The worker thread to add a job to. + + \return A new job to process, or NULL if there is none. +*/ +kthread_job_t *thd_worker_dequeue_job(kthread_worker_t *worker); + +__END_DECLS + +#endif /* __KOS_WORKER_THREAD_H */ diff --git a/kernel/arch/dreamcast/hardware/asic.c b/kernel/arch/dreamcast/hardware/asic.c index 3bc486c6..529ec77a 100644 --- a/kernel/arch/dreamcast/hardware/asic.c +++ b/kernel/arch/dreamcast/hardware/asic.c @@ -102,6 +102,7 @@ #include <dc/asic.h> #include <arch/spinlock.h> #include <kos/genwait.h> +#include <kos/worker_thread.h> /* XXX These based on g1ata.c and pvr.h and should be replaced by a standardized method */ #define IN32(addr) (* ( (volatile uint32_t *)(addr) ) ) @@ -121,11 +122,8 @@ typedef struct { struct asic_thdata { asic_evt_handler hdl; uint32_t source; - kthread_t *thd; - int genwait_obj; + kthread_worker_t *worker; void *data; - volatile bool quit; - volatile bool pending; void (*ack_and_mask)(uint16_t); void (*unmask)(uint16_t); }; @@ -253,29 +251,13 @@ void asic_shutdown(void) { asic_evt_shutdown(); } -static void * asic_threaded_irq(void *data) { +static void asic_threaded_irq(void *data) { struct asic_thdata *thdata = data; - int flags; - - for (;;) { - flags = irq_disable(); - - if (!thdata->pending) - genwait_wait(&thdata->genwait_obj, thdata->thd->label, 0, NULL); - - irq_restore(flags); - if (thdata->quit) - break; + thdata->hdl(thdata->source, thdata->data); - thdata->pending = false; - thdata->hdl(thdata->source, thdata->data); - - if (thdata->unmask) - thdata->unmask(thdata->source); - } - - return NULL; + if (thdata->unmask) + thdata->unmask(thdata->source); } static void asic_thirq_dispatch(uint32_t source, void *data) { @@ -286,8 +268,7 @@ static void asic_thirq_dispatch(uint32_t source, void *data) { thdata->source = source; - thdata->pending = true; - genwait_wake_one(&thdata->genwait_obj); + thd_worker_wakeup(thdata->worker); } int asic_evt_request_threaded_handler(uint16_t code, asic_evt_handler hnd, @@ -297,6 +278,7 @@ int asic_evt_request_threaded_handler(uint16_t code, asic_evt_handler hnd, { struct asic_thdata *thdata; uint32_t flags; + kthread_t *thd; thdata = malloc(sizeof(*thdata)); if (!thdata) @@ -304,27 +286,26 @@ int asic_evt_request_threaded_handler(uint16_t code, asic_evt_handler hnd, thdata->hdl = hnd; thdata->data = data; - thdata->quit = false; - thdata->pending = false; thdata->ack_and_mask = ack_and_mask; thdata->unmask = unmask; flags = irq_disable(); - thdata->thd = thd_create(0, asic_threaded_irq, thdata); - if (!thdata->thd) { + thdata->worker = thd_worker_create(asic_threaded_irq, thdata); + if (!thdata->worker) { irq_restore(flags); free(thdata); return -1; /* TODO: What return code? */ } /* Set a reasonable name to ID the thread */ - snprintf(thdata->thd->label, KTHREAD_LABEL_SIZE, + thd = thd_worker_get_thread(thdata->worker); + snprintf(thd->label, KTHREAD_LABEL_SIZE, "Threaded IRQ code: 0x%x evt: 0x%.4x", ((code >> 16) & 0xf), (code & 0xffff)); /* Highest priority */ - //thd_set_prio(thdata->thd, 0); + //thd_set_prio(thd, 0); asic_evt_set_handler(code, asic_thirq_dispatch, thdata); @@ -347,11 +328,8 @@ void asic_evt_remove_handler(uint16_t code) if (entry.hdl == asic_thirq_dispatch) { thdata = entry.data; - thdata->quit = true; - - genwait_wake_one(&thdata->genwait_obj); - thd_join(thdata->thd, NULL); + thd_worker_destroy(thdata->worker); free(thdata); } } diff --git a/kernel/arch/dreamcast/hardware/maple/controller.c b/kernel/arch/dreamcast/hardware/maple/controller.c index f6678c1f..1db9bfa0 100644 --- a/kernel/arch/dreamcast/hardware/maple/controller.c +++ b/kernel/arch/dreamcast/hardware/maple/controller.c @@ -49,7 +49,9 @@ void cont_btn_callback(uint8_t addr, uint32_t btns, cont_btn_callback_t cb) { } /* Response callback for the GETCOND Maple command. */ -static void cont_reply(maple_state_t *, maple_frame_t *frm) { +static void cont_reply(maple_state_t *st, maple_frame_t *frm) { + (void)st; + maple_response_t *resp; uint32_t *respbuf; cont_cond_t *raw; diff --git a/kernel/arch/dreamcast/hardware/maple/dreameye.c b/kernel/arch/dreamcast/hardware/maple/dreameye.c index fad5d40e..94c9cde8 100644 --- a/kernel/arch/dreamcast/hardware/maple/dreameye.c +++ b/kernel/arch/dreamcast/hardware/maple/dreameye.c @@ -19,7 +19,9 @@ static int dreameye_send_get_image(maple_device_t *dev, static dreameye_state_t *first_state = NULL; -static void dreameye_get_image_count_cb(maple_state_t *, maple_frame_t *frame) { +static void dreameye_get_image_count_cb(maple_state_t *st, maple_frame_t *frame) { + (void)st; + dreameye_state_t *de; maple_response_t *resp; uint32 *respbuf32; @@ -59,7 +61,9 @@ static void dreameye_get_image_count_cb(maple_state_t *, maple_frame_t *frame) { genwait_wake_all(frame); } -static void dreameye_get_transfer_count_cb(maple_state_t *, maple_frame_t *frame) { +static void dreameye_get_transfer_count_cb(maple_state_t *st, maple_frame_t *frame) { + (void)st; + dreameye_state_t *de; maple_response_t *resp; uint32 *respbuf32; @@ -139,7 +143,9 @@ int dreameye_get_image_count(maple_device_t *dev, int block) { return MAPLE_EOK; } -static void dreameye_get_image_cb(maple_state_t *, maple_frame_t *frame) { +static void dreameye_get_image_cb(maple_state_t *st, maple_frame_t *frame) { + (void)st; + maple_device_t *dev; maple_response_t *resp; uint32 *respbuf32; @@ -327,7 +333,9 @@ fail: return MAPLE_EFAIL; } -static void dreameye_erase_cb(maple_state_t *, maple_frame_t *frame) { +static void dreameye_erase_cb(maple_state_t *st, maple_frame_t *frame) { + (void)st; + maple_response_t *resp; uint8 *respbuf; diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index 1162c6db..9fdb04aa 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -580,7 +580,9 @@ static void kbd_check_poll(maple_frame_t *frm) { } } -static void kbd_reply(maple_state_t *, maple_frame_t *frm) { +static void kbd_reply(maple_state_t *st, maple_frame_t *frm) { + (void)st; + maple_response_t *resp; uint32 *respbuf; kbd_state_t *state; diff --git a/kernel/arch/dreamcast/hardware/maple/mouse.c b/kernel/arch/dreamcast/hardware/maple/mouse.c index 662fbe96..94a13c35 100644 --- a/kernel/arch/dreamcast/hardware/maple/mouse.c +++ b/kernel/arch/dreamcast/hardware/maple/mouse.c @@ -9,7 +9,9 @@ #include <string.h> #include <assert.h> -static void mouse_reply(maple_state_t *, maple_frame_t *frm) { +static void mouse_reply(maple_state_t *st, maple_frame_t *frm) { + (void)st; + maple_response_t *resp; uint32 *respbuf; mouse_cond_t *raw; diff --git a/kernel/arch/dreamcast/hardware/maple/purupuru.c b/kernel/arch/dreamcast/hardware/maple/purupuru.c index a6a93d3a..40e93ef8 100644 --- a/kernel/arch/dreamcast/hardware/maple/purupuru.c +++ b/kernel/arch/dreamcast/hardware/maple/purupuru.c @@ -14,7 +14,9 @@ /* Be warned, not all purus are created equal, in fact, most of them act different for just about everything you feed to them. */ -static void purupuru_rumble_cb(maple_state_t *, maple_frame_t *frame) { +static void purupuru_rumble_cb(maple_state_t *st, maple_frame_t *frame) { + (void)st; + /* Unlock the frame */ maple_frame_unlock(frame); diff --git a/kernel/arch/dreamcast/hardware/maple/sip.c b/kernel/arch/dreamcast/hardware/maple/sip.c index c6a7ad70..7ad55b0f 100644 --- a/kernel/arch/dreamcast/hardware/maple/sip.c +++ b/kernel/arch/dreamcast/hardware/maple/sip.c @@ -15,7 +15,9 @@ #define SIP_START_SAMPLING 0x80 -static void sip_start_sampling_cb(maple_state_t *, maple_frame_t *frame) { +static void sip_start_sampling_cb(maple_state_t *st, maple_frame_t *frame) { + (void)st; + sip_state_t *sip; maple_response_t *resp; @@ -36,7 +38,9 @@ static void sip_start_sampling_cb(maple_state_t *, maple_frame_t *frame) { genwait_wake_all(frame); } -static void sip_stop_sampling_cb(maple_state_t *, maple_frame_t *frame) { +static void sip_stop_sampling_cb(maple_state_t *st, maple_frame_t *frame) { + (void)st; + sip_state_t *sip; maple_response_t *resp; @@ -207,7 +211,9 @@ int sip_stop_sampling(maple_device_t *dev, int block) { return MAPLE_EOK; } -static void sip_reply(maple_state_t *, maple_frame_t *frm) { +static void sip_reply(maple_state_t *st, maple_frame_t *frm) { + (void)st; + maple_response_t *resp; uint32 *respbuf; sip_state_t *sip; diff --git a/kernel/arch/dreamcast/hardware/maple/vmu.c b/kernel/arch/dreamcast/hardware/maple/vmu.c index eb9e8792..d1854fcb 100644 --- a/kernel/arch/dreamcast/hardware/maple/vmu.c +++ b/kernel/arch/dreamcast/hardware/maple/vmu.c @@ -63,7 +63,9 @@ static int vmu_attach(maple_driver_t *drv, maple_device_t *dev) { return 0; } -static void vmu_poll_reply(maple_state_t *, maple_frame_t *frm) { +static void vmu_poll_reply(maple_state_t *st, maple_frame_t *frm) { + (void)st; + maple_response_t *resp; uint32_t *respbuf; vmu_cond_t *raw; @@ -264,7 +266,9 @@ int vmu_set_icon_shape(maple_device_t *dev, uint8_t icon_shape) { can stay the same */ /* Callback that unlocks the frame, general use */ -static void vmu_gen_callback(maple_state_t *, maple_frame_t *frame) { +static void vmu_gen_callback(maple_state_t *st, maple_frame_t *frame) { + (void)st; + /* Unlock the frame for the next usage */ maple_frame_unlock(frame); @@ -412,7 +416,9 @@ void vmu_set_icon(const char *vmu_icon) { /* Read the data in block blocknum into buffer, return a -1 if an error occurs, for now we ignore MAPLE_RESPONSE_FILEERR, which will be changed shortly */ -static void vmu_block_read_callback(maple_state_t *, maple_frame_t *frm) { +static void vmu_block_read_callback(maple_state_t *st, maple_frame_t *frm) { + (void)st; + ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2024-04-27 03:45:11
|
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 a69d61cdf816bd520b873698ba26832dce49d496 (commit) via 12a8218d4fcad189bc94ac9673fbd828c52457e6 (commit) via c751407a3d3568835b8e225c5224531668c61120 (commit) via 5037642a668108ec8760ef12f311b3487297089b (commit) from b51c6aa33c13fa0b68f6485e06108bf19c53d812 (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 a69d61cdf816bd520b873698ba26832dce49d496 Merge: 12a8218d 5037642a Author: Lawrence Sebald <ljs...@us...> Date: Fri Apr 26 23:27:59 2024 -0400 Merge pull request #525 from KallistiOS/treeless-clone dc-chain: Use treeless clone when git repo is used as source commit 12a8218d4fcad189bc94ac9673fbd828c52457e6 Merge: b51c6aa3 c751407a Author: Lawrence Sebald <ljs...@us...> Date: Fri Apr 26 23:26:04 2024 -0400 Merge pull request #527 from Dreamcast-Projects/fix_example_warns Fix example warnings and docs in SQ commit c751407a3d3568835b8e225c5224531668c61120 Author: Andress Barajas <and...@gm...> Date: Fri Apr 26 20:10:17 2024 -0700 Fix example warnings and docs in SQ commit 5037642a668108ec8760ef12f311b3487297089b Author: darcagn <da...@pr...> Date: Fri Apr 26 17:10:10 2024 -0600 Use treeless clone when git repo is used as source ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/Makefile | 2 +- examples/dreamcast/basic/exec/exec.c | 2 -- examples/dreamcast/kgl/basic/gl/gltest.c | 2 +- examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c | 2 +- examples/dreamcast/kgl/benchmarks/trimark/trimark.c | 2 +- examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c | 2 +- examples/dreamcast/parallax/delay_cube/delay_cube.c | 2 +- examples/dreamcast/parallax/rotocube/rotocube.c | 2 +- examples/dreamcast/pvr/pvrmark/pvrmark.c | 2 +- examples/dreamcast/pvr/pvrmark_strips/pvrmark_strips.c | 2 +- .../dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c | 2 +- examples/dreamcast/pvr/texture_render/texture_render.c | 2 +- kernel/arch/dreamcast/include/dc/sq.h | 6 +++--- utils/dc-chain/scripts/download.mk | 2 +- 14 files changed, 15 insertions(+), 17 deletions(-) diff --git a/examples/dreamcast/Makefile b/examples/dreamcast/Makefile index dc867de2..23e25f7b 100644 --- a/examples/dreamcast/Makefile +++ b/examples/dreamcast/Makefile @@ -5,7 +5,7 @@ # DIRS = 2ndmix basic libdream kgl hello sound png network vmu conio pvr video \ - lua parallax modem dreameye sd g1ata lightgun keyboard sdl random rumble \ + lua parallax modem dreameye sd g1ata lightgun keyboard sdl dev rumble \ micropython ifdef KOS_CCPLUS diff --git a/examples/dreamcast/basic/exec/exec.c b/examples/dreamcast/basic/exec/exec.c index a617341c..edcb201d 100644 --- a/examples/dreamcast/basic/exec/exec.c +++ b/examples/dreamcast/basic/exec/exec.c @@ -7,8 +7,6 @@ #include <kos.h> #include <assert.h> -#define false (1 == 0) - int main(int argc, char **argv) { file_t f; void *subelf; diff --git a/examples/dreamcast/kgl/basic/gl/gltest.c b/examples/dreamcast/kgl/basic/gl/gltest.c index 17f9bdc8..c918ee91 100644 --- a/examples/dreamcast/kgl/basic/gl/gltest.c +++ b/examples/dreamcast/kgl/basic/gl/gltest.c @@ -235,7 +235,7 @@ int main(int argc, char **argv) { } pvr_get_stats(&stats); - printf("VBL Count: %ld, last_time: %d, frame rate: %f fps\n", + printf("VBL Count: %d, last_time: %lld, frame rate: %f fps\n", stats.vbl_count, stats.frame_last_time, (double)stats.frame_rate); return 0; diff --git a/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c b/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c index f4c0ff03..5951d2b1 100644 --- a/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c +++ b/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c @@ -39,7 +39,7 @@ void stats(void) { pvr_stats_t stats; pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", + dbglog(DBG_DEBUG, "3D Stats: %d VBLs, frame rate ~%f fps\n", stats.vbl_count, (double)stats.frame_rate); } diff --git a/examples/dreamcast/kgl/benchmarks/trimark/trimark.c b/examples/dreamcast/kgl/benchmarks/trimark/trimark.c index d946cd9d..c4451b5c 100644 --- a/examples/dreamcast/kgl/benchmarks/trimark/trimark.c +++ b/examples/dreamcast/kgl/benchmarks/trimark/trimark.c @@ -39,7 +39,7 @@ void stats(void) { pvr_stats_t stats; pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", + dbglog(DBG_DEBUG, "3D Stats: %d VBLs, frame rate ~%f fps\n", stats.vbl_count, (double)stats.frame_rate); } diff --git a/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c b/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c index aa2cfcd0..96f00f90 100644 --- a/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c +++ b/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c @@ -39,7 +39,7 @@ void stats(void) { pvr_stats_t stats; pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", + dbglog(DBG_DEBUG, "3D Stats: %d VBLs, frame rate ~%f fps\n", stats.vbl_count, (double)stats.frame_rate); } diff --git a/examples/dreamcast/parallax/delay_cube/delay_cube.c b/examples/dreamcast/parallax/delay_cube/delay_cube.c index 45189664..a4ae22ef 100644 --- a/examples/dreamcast/parallax/delay_cube/delay_cube.c +++ b/examples/dreamcast/parallax/delay_cube/delay_cube.c @@ -185,7 +185,7 @@ int main(int argc, char **argv) { // You have to keep a watch on these, especially the vertex used // for really poly intensive effects. pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld vblanks, frame rate ~%f fps, max vertex used %d bytes\n", + dbglog(DBG_DEBUG, "3D Stats: %d vblanks, frame rate ~%f fps, max vertex used %d bytes\n", stats.vbl_count, (double)stats.frame_rate, stats.vtx_buffer_used_max); return 0; diff --git a/examples/dreamcast/parallax/rotocube/rotocube.c b/examples/dreamcast/parallax/rotocube/rotocube.c index 347562f9..7f5b50bb 100644 --- a/examples/dreamcast/parallax/rotocube/rotocube.c +++ b/examples/dreamcast/parallax/rotocube/rotocube.c @@ -178,7 +178,7 @@ int main(int argc, char **argv) { // You have to keep a watch on these, especially the vertex used // for really poly intensive effects. pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld vblanks, frame rate ~%f fps, max vertex used %d bytes\n", + dbglog(DBG_DEBUG, "3D Stats: %d vblanks, frame rate ~%f fps, max vertex used %d bytes\n", stats.vbl_count, (double)stats.frame_rate, stats.vtx_buffer_used_max); return 0; diff --git a/examples/dreamcast/pvr/pvrmark/pvrmark.c b/examples/dreamcast/pvr/pvrmark/pvrmark.c index e53429f5..c2edb7a1 100644 --- a/examples/dreamcast/pvr/pvrmark/pvrmark.c +++ b/examples/dreamcast/pvr/pvrmark/pvrmark.c @@ -33,7 +33,7 @@ void stats(void) { pvr_stats_t stats; pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", + dbglog(DBG_DEBUG, "3D Stats: %d VBLs, frame rate ~%f fps\n", stats.vbl_count, (double)stats.frame_rate); } diff --git a/examples/dreamcast/pvr/pvrmark_strips/pvrmark_strips.c b/examples/dreamcast/pvr/pvrmark_strips/pvrmark_strips.c index cc2624b9..bcca11e8 100644 --- a/examples/dreamcast/pvr/pvrmark_strips/pvrmark_strips.c +++ b/examples/dreamcast/pvr/pvrmark_strips/pvrmark_strips.c @@ -33,7 +33,7 @@ void stats(void) { pvr_stats_t stats; pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", + dbglog(DBG_DEBUG, "3D Stats: %d VBLs, frame rate ~%f fps\n", stats.vbl_count, (double)stats.frame_rate); } diff --git a/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c b/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c index 62af9a2b..df3e1d73 100644 --- a/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c +++ b/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c @@ -33,7 +33,7 @@ void stats(void) { pvr_stats_t stats; pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld frames, frame rate ~%f fps\n", + dbglog(DBG_DEBUG, "3D Stats: %d frames, frame rate ~%f fps\n", stats.vbl_count, (double)stats.frame_rate); } diff --git a/examples/dreamcast/pvr/texture_render/texture_render.c b/examples/dreamcast/pvr/texture_render/texture_render.c index 231b45c0..b5aa600e 100644 --- a/examples/dreamcast/pvr/texture_render/texture_render.c +++ b/examples/dreamcast/pvr/texture_render/texture_render.c @@ -246,7 +246,7 @@ int main(int argc, char **argv) { (double)(counter / ((float)end - start) * 1000.0f)); pvr_get_stats(&stats); - printf("From pvr_get_stats:\n\tVBlank Count: %lu\n\tFrame Count: %lu\n", + printf("From pvr_get_stats:\n\tVBlank Count: %u\n\tFrame Count: %u\n", stats.vbl_count, stats.frame_count); pvr_mem_free(d_texture); diff --git a/kernel/arch/dreamcast/include/dc/sq.h b/kernel/arch/dreamcast/include/dc/sq.h index 3fc2018a..37ffbeeb 100644 --- a/kernel/arch/dreamcast/include/dc/sq.h +++ b/kernel/arch/dreamcast/include/dc/sq.h @@ -166,7 +166,7 @@ void *sq_fast_cpy(void *dest, const void *src, size_t n); \param n The number of bytes to set (multiple of 32). \return The original value of dest. - \sa sq_set16(), sq_set32(), sq_set_pvr() + \sa sq_set16(), sq_set32() */ void *sq_set(void *dest, uint32_t c, size_t n); @@ -185,7 +185,7 @@ void *sq_set(void *dest, uint32_t c, size_t n); \param n The number of bytes to set (multiple of 32). \return The original value of dest. - \sa sq_set(), sq_set32(), sq_set_pvr() + \sa sq_set(), sq_set32() */ void *sq_set16(void *dest, uint32_t c, size_t n); @@ -203,7 +203,7 @@ void *sq_set16(void *dest, uint32_t c, size_t n); \param n The number of bytes to set (multiple of 32). \return The original value of dest. - \sa sq_set(), sq_set16(), sq_set_pvr() + \sa sq_set(), sq_set16() */ void *sq_set32(void *dest, uint32_t c, size_t n); diff --git a/utils/dc-chain/scripts/download.mk b/utils/dc-chain/scripts/download.mk index af2f6ac3..8c19eafb 100644 --- a/utils/dc-chain/scripts/download.mk +++ b/utils/dc-chain/scripts/download.mk @@ -127,7 +127,7 @@ GIT_TARGETS = $(foreach target,$(FROM_GIT_REPOS), $(stamp_$(target)_download)) $(GIT_TARGETS): @echo "+++ Cloning $(git_repo)..." rm -rf $(name) - git clone $(git_repo) $(additional_git_args) $(if $(dest),$(dest),$(name)) + git clone --filter=tree:0 $(git_repo) $(additional_git_args) $(if $(dest),$(dest),$(name)) touch $@ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-04-26 22:42:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via b51c6aa33c13fa0b68f6485e06108bf19c53d812 (commit) via a1d833d6b5c9f98bf88a0711a135ccdc28083cff (commit) via a28cee7b7fd1be0bced87e4bf9561302d50ec888 (commit) via 91eaa0ccb0258865cab89baf93ad760900e6eeb3 (commit) via d179912c8550963494b03ecc57a897b0986fdf31 (commit) from 04c59b4b3ff9a5a0b42bd203a3603f609dded7f0 (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 b51c6aa33c13fa0b68f6485e06108bf19c53d812 Merge: a1d833d6 a28cee7b Author: darcagn <da...@pr...> Date: Fri Apr 26 16:40:32 2024 -0600 Merge pull request #518 from KallistiOS/dc_chain_no_phobos Updated dc-chain for DLang + BETA m4-single support commit a1d833d6b5c9f98bf88a0711a135ccdc28083cff Author: Falco Girgis <gyr...@gm...> Date: Fri Apr 26 15:29:05 2024 -0500 Dynamically Modify Scheduler Frequency HZ at Runtime (#520) * Added ability to modify scheduler HZ at runtime - thd_set_hz(): sets the current scheduler frequency (1-1000 hz) - thd_get_hz(): gets the current scheduler frequency * Updated sysconf() return for _SC_CLK_TCK. commit a28cee7b7fd1be0bced87e4bf9561302d50ec888 Author: Falco Girgis <gyr...@gm...> Date: Fri Apr 26 15:26:32 2024 -0500 Update utils/dc-chain/config/config.mk.13.2.1-dev.sample Co-authored-by: Lawrence Sebald <ljs...@us...> commit 91eaa0ccb0258865cab89baf93ad760900e6eeb3 Author: Falco Girgis <gyr...@gm...> Date: Sun Apr 21 18:49:33 2024 -0500 Updated dc-chain changelog.txt. commit d179912c8550963494b03ecc57a897b0986fdf31 Author: Falco Girgis <gyr...@gm...> Date: Sat Apr 20 23:52:54 2024 -0500 Updated dc-chain for DLang + m4-single support - Added an option for D to the pass2 langauges list, with a note that dependencies must already have been installed. - Added --disable-libphobos flag to the pass2 script to prevent it from being built with D, but it's also gracefully ignored without D. - Added -m4-single to the default list of FP configurations to build WHILE STILL KEEPING a strict warning about early beta support for it. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + include/kos/thread.h | 25 +++++++++++++++++++ kernel/arch/dreamcast/include/arch/arch.h | 11 ++++++++- kernel/libc/posix/sysconf.c | 18 +++++++++++--- kernel/thread/thread.c | 26 ++++++++++++++++---- utils/dc-chain/config/config.mk.13.2.1-dev.sample | 29 +++++++++++++---------- utils/dc-chain/doc/changelog.txt | 3 +++ utils/dc-chain/scripts/gcc-pass2.mk | 1 + 8 files changed, 93 insertions(+), 21 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 0850517e..7a1706e0 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -221,6 +221,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Added new driver for the SH4's UBC + high-level breakpoint API [FG] - DC Add support for French AZERTY keyboards [PC] - DC Increased the resolution of pvr_stats_t from milli to nanoseconds [FG] +- *** Added support for modifying scheduler frequency at runtime [FG] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/include/kos/thread.h b/include/kos/thread.h index 6c09dd5a..0649f0c1 100644 --- a/include/kos/thread.h +++ b/include/kos/thread.h @@ -3,6 +3,8 @@ include/kos/thread.h Copyright (C) 2000, 2001, 2002, 2003 Megan Potter Copyright (C) 2009, 2010, 2016 Lawrence Sebald + Copyright (C) 2023 Colton Pawielski + Copyright (C) 2023, 2024 Falco Girgis */ @@ -598,6 +600,29 @@ int thd_set_mode(int mode) __deprecated; */ int thd_get_mode(void) __deprecated; +/** \brief Set the scheduler's frequency. + + Sets the frequency of the scheduler interrupts in hertz. + + \param hertz The new frequency in hertz (1-1000) + + \retval 0 The frequency was updated successfully. + \retval -1 \p hertz is invalid. + + \sa thd_get_hz(), HZ +*/ +int thd_set_hz(unsigned int hertz); + +/** \brief Fetch the scheduler's current frequency. + + Queries the scheduler for its interrupt frequency in hertz. + + \return Scheduler frequency in hertz. + + \sa thd_set_hz(), HZ +*/ +unsigned thd_get_hz(void); + /** \brief Wait for a thread to exit. \relatesalso kthread_t diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h index e16b4eec..0562fc36 100644 --- a/kernel/arch/dreamcast/include/arch/arch.h +++ b/kernel/arch/dreamcast/include/arch/arch.h @@ -52,7 +52,16 @@ extern uint32 _arch_mem_top; /** \brief Base address of available physical pages. */ #define page_phys_base 0x8c010000 -/** \brief Number of timer ticks per second. */ +/** \brief Scheduler interrupt frequency + + Timer interrupt frequency for the KOS thread scheduler. + + \note + This value is what KOS uses initially upon startup, but it can be + reconfigured at run-time. + + \sa thd_get_hz(), thd_set_hz() +*/ #define HZ 100 /** \brief Default thread stack size. */ diff --git a/kernel/libc/posix/sysconf.c b/kernel/libc/posix/sysconf.c index 06eeed4e..59b7b200 100644 --- a/kernel/libc/posix/sysconf.c +++ b/kernel/libc/posix/sysconf.c @@ -1,30 +1,42 @@ /* KallistiOS ##version## sysconf.c - Copyright (C) 2023 Falco Girgis + Copyright (C) 2023, 2024 Falco Girgis */ #include <arch/arch.h> #include <kos/netcfg.h> #include <kos/fs.h> +#include <kos/thread.h> #include <malloc.h> #include <unistd.h> #include <errno.h> +#include <limits.h> +#include <stdint.h> long sysconf(int name) { switch(name) { case _SC_HOST_NAME_MAX: return sizeof ((netcfg_t *)NULL)->hostname; + case _SC_CHILD_MAX: + return 1; + case _SC_CLK_TCK: - return HZ; + return thd_get_hz(); case _SC_OPEN_MAX: return FD_SETSIZE; case _SC_PAGESIZE: return PAGESIZE; + + case _SC_SEM_NSEMS_MAX: + return UINT32_MAX; + + case _SC_SEM_VALUE_MAX: + return UINT32_MAX; case _SC_PHYS_PAGES: return page_count; @@ -35,7 +47,7 @@ long sysconf(int name) { case _SC_NPROCESSORS_CONF: case _SC_NPROCESSORS_ONLN: return 1; - + default: errno = EINVAL; return -1; diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index 6addff22..37a1105e 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -3,6 +3,8 @@ kernel/thread/thread.c Copyright (C) 2000, 2001, 2002, 2003 Megan Potter Copyright (C) 2010, 2016 Lawrence Sebald + Copyright (C) 2023 Colton Pawielski + Copyright (C) 2023, 2024 Falco Girgis */ #include <stdlib.h> @@ -11,6 +13,7 @@ #include <malloc.h> #include <stdio.h> #include <stdlib.h> +#include <assert.h> #include <reent.h> #include <errno.h> #include <kos/thread.h> @@ -22,7 +25,6 @@ #include <arch/irq.h> #include <arch/timer.h> #include <arch/arch.h> -#include <assert.h> /* @@ -50,6 +52,9 @@ static inline size_t align_to(size_t address, size_t alignment) { /*****************************************************************************/ /* Thread scheduler data */ +/* Scheduler timer interrupt frequency (Hertz) */ +static unsigned int thd_sched_ms = 1000 / HZ; + /* Thread list. This includes all threads except dead ones. */ static struct ktlist thd_list; @@ -760,7 +765,7 @@ static void thd_timer_hnd(irq_context_t *context) { //printf("timer woke at %d\n", (uint32_t)now); thd_schedule(0, now); - timer_primary_wakeup(1000 / HZ); + timer_primary_wakeup(thd_sched_ms); } /*****************************************************************************/ @@ -940,6 +945,19 @@ int thd_get_mode(void) { return thd_mode; } +unsigned thd_get_hz(void) { + return 1000 / thd_sched_ms; +} + +int thd_set_hz(unsigned int hertz) { + if(!hertz || hertz > 1000) + return -1; + + thd_sched_ms = 1000 / hertz; + + return 0; +} + /* Delete a TLS key. Note that currently this doesn't prevent you from reusing the key after deletion. This seems ok, as the pthreads standard states that using the key after deletion results in "undefined behavior". @@ -1048,9 +1066,9 @@ int thd_init(void) { timer_primary_set_callback(thd_timer_hnd); /* Schedule our first wakeup */ - timer_primary_wakeup(1000 / HZ); + timer_primary_wakeup(thd_sched_ms); - dbglog(DBG_INFO, "thd: pre-emption enabled, HZ=%d\n", HZ); + dbglog(DBG_INFO, "thd: pre-emption enabled, HZ=%u\n", thd_get_hz()); return 0; } diff --git a/utils/dc-chain/config/config.mk.13.2.1-dev.sample b/utils/dc-chain/config/config.mk.13.2.1-dev.sample index 7576900c..6239c8cf 100644 --- a/utils/dc-chain/config/config.mk.13.2.1-dev.sample +++ b/utils/dc-chain/config/config.mk.13.2.1-dev.sample @@ -114,24 +114,27 @@ install_mode=install-strip # detected on some OS. makejobs=-j2 -# Languages (c|c++|objc|obj-c++) -# Set the languages to build for pass 2 of building gcc for sh-elf. The default -# here is to build C, C++, Objective C, and Objective C++. You may want to take -# out the latter two if you're not worried about them and/or you're short on -# hard drive space. +# Languages (c|c++|objc|obj-c++|d) +# Set the languages to build for sh-elf gcc compilation pass 2. The default is +# to build everything used by all KOS examples; however, only C is actually +# required for KOS itself. D may also be enabled optionally on POSIX platforms +# which have its external dependencies installed. pass2_languages=c,c++,objc,obj-c++ -# Floating point precision support (m4|m4-single|m4-single-only) +# Floating point precision support (m4-single-only|m4-single|m4) # Build support for various SH4 floating-point operation ABIs. KallistiOS only -# officially supports single-precision-only mode. Add m4 (double precision) or -# m4-single (single precision) to build experimental support for those ABIs. -precision_modes=m4-single-only -#precision_modes=m4,m4-single,m4-single-only - -# Default floating point mode (m4|m4-single|m4-single-only) +# officially supports single-precision-only mode (m4-single-only); however, +# experimental support for single-precision-default mode (m4-single) has just +# been added to allow for the use of full 64-bit doubles. You may also add m4 +# (double-precision-default) which hasn't been tested, or you can simply stick +# with m4-single-only to save disk space. +precision_modes=m4-single-only,m4-single +#precision_modes=m4-single-only,m4-single,m4 + +# Default floating point mode (m4-single-only|m4-single|m4) # Choose the default floating point precision ABI used when GCC is invoked. This # can be overridden by using passing -m4, -m4-single, or -m4-single-only to GCC. -# KallistiOS currently only supports m4-single-only, so that is the default. +# KOS currently only officially supports m4-single-only, so it is the default. default_precision=m4-single-only # GCC threading model (single|kos|posix*) diff --git a/utils/dc-chain/doc/changelog.txt b/utils/dc-chain/doc/changelog.txt index 5ba1e808..3d86f1f4 100644 --- a/utils/dc-chain/doc/changelog.txt +++ b/utils/dc-chain/doc/changelog.txt @@ -1,3 +1,6 @@ +2024-04-21: Added D to list of supported languages, added m4-single as a + default precision mode, added --disable-libphobos to gcc-pass2 + (Falco Girgis) 2024-01-14: Added config option for disabling native language support (NLS) in GCC. (Falco Girgis) 2024-01-06: Update documentations (Mickaël Cardoso) diff --git a/utils/dc-chain/scripts/gcc-pass2.mk b/utils/dc-chain/scripts/gcc-pass2.mk index 38a2abb9..74292f62 100644 --- a/utils/dc-chain/scripts/gcc-pass2.mk +++ b/utils/dc-chain/scripts/gcc-pass2.mk @@ -18,6 +18,7 @@ $(build_gcc_pass2): logdir --with-gnu-ld \ --with-newlib \ --disable-libssp \ + --disable-libphobos \ --enable-threads=$(thread_model) \ --enable-languages=$(pass2_languages) \ --enable-checking=release \ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2024-04-26 03:32:02
|
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 04c59b4b3ff9a5a0b42bd203a3603f609dded7f0 (commit) via 9e2e9a6957ce3fd65d2d30ece8d85e3824b04369 (commit) via 3312ee367ac9fd8085fe82972b690c31b416de62 (commit) via 48f726bca52a2236b9fd4eedc3213d932ee976fa (commit) via bf7522237785aeadf9db36c60dac5a7e7e76729f (commit) via f2a190712b6ad193e2fe1036ec5012d3aa72186d (commit) via 620b446751285932f4213266599f55f1de79a90a (commit) via 316c185a868bac317d8127248db20bc7908f74ed (commit) via 4e17691a9baa48081ec650eecfe49ff57050e081 (commit) via cf95ea3d84565d65d6e0e6ecf3f70d13badf117a (commit) via e0989c9d3d157ba0f7f9834c130206376ec00aa2 (commit) via 84d935187fd8ceccda9e7313467d99f5755d50e7 (commit) via b0c09b2bec4756a87a355764ac00c0ec76a83b35 (commit) via 8e103815db2de84d171be9a0b92e854359ac4601 (commit) via 3a5ea762b0f257180bd980a435eb17ada53026e9 (commit) via 842a0c489904997f6872725a18919557dda1e919 (commit) from 1ff6f043444446a09d55e464fd9a73be5307c740 (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 04c59b4b3ff9a5a0b42bd203a3603f609dded7f0 Author: Falco Girgis <gyr...@gm...> Date: Thu Apr 25 22:27:18 2024 -0500 Increased Timing Resolution of pvr_stats_t (#471) * Increased timing resolution of pvr_stats_t. - Now that the TMU driver has been upgraded, this can all be bumped up from millisecond to nanosecond resolution. * Addressed review feedback. - Noted the pvr_stats_t precision upgrade in the CHANGELOG. - The size of the rendered farme time bars in serpent_dma had to be adjusted for the new resolution. * Addressed review feedback 1) pvr_stats_t timestamps are now stored as uint64_t 2) pvr_stats_t struct was reorganized for optimal packing 3) PVR vblank events are no longer grabbing timestamps for no reason 4) PVR stats formatting in serpent_dma example was fixed * Added units to render stats text commit 9e2e9a6957ce3fd65d2d30ece8d85e3824b04369 Merge: 3312ee36 cf95ea3d Author: Lawrence Sebald <ljs...@us...> Date: Thu Apr 25 23:21:02 2024 -0400 Merge pull request #493 from KallistiOS/No_u_dev Allow /dev/ to exist independently of /dev/random commit 3312ee367ac9fd8085fe82972b690c31b416de62 Merge: 48f726bc 620b4467 Author: Lawrence Sebald <ljs...@us...> Date: Thu Apr 25 23:11:19 2024 -0400 Merge pull request #519 from KallistiOS/warnings_fixes Fixed Release Build Warnings from Defining NDEBUG. commit 48f726bca52a2236b9fd4eedc3213d932ee976fa Merge: 1ff6f043 bf752223 Author: Lawrence Sebald <ljs...@us...> Date: Thu Apr 25 23:09:17 2024 -0400 Merge pull request #524 from KallistiOS/kbd_atomics_fix Fixed kbd build issues due to <stdatomic> in C++ commit bf7522237785aeadf9db36c60dac5a7e7e76729f Author: Falco Girgis <gyr...@gm...> Date: Wed Apr 24 23:37:30 2024 -0500 Addressing review feedback. commit f2a190712b6ad193e2fe1036ec5012d3aa72186d Author: Falco Girgis <gyr...@gm...> Date: Wed Apr 24 21:29:59 2024 -0500 Fixed kbd build issues due to <stdatomic> in C++. - keyboard.h's reliance on <stdatomic.h> was breaking C++ builds, since stupid C++ didn't implement compatibilty with this header until C++23. - Made the atomic kbd_state_t::queue_len just a volatile integer - Modifed all code touching queue_len to do so with interrupts disabled, to essentially emulate atomic behavior. commit cf95ea3d84565d65d6e0e6ecf3f70d13badf117a Author: Donald Haase <qu...@ya...> Date: Fri Apr 12 23:38:50 2024 -0400 Clean up formatting From @andressbarajas' suggestions. Co-authored-by: Andy Barajas <and...@gm...> commit e0989c9d3d157ba0f7f9834c130206376ec00aa2 Merge: 84d93518 33acd8ae Author: Donald Haase <qu...@ya...> Date: Sun Mar 24 22:01:19 2024 -0400 Merge branch 'master' into No_u_dev commit 84d935187fd8ceccda9e7313467d99f5755d50e7 Author: QuzarDC <qu...@co...> Date: Tue Mar 5 09:02:13 2024 -0500 Add /dev/null commit b0c09b2bec4756a87a355764ac00c0ec76a83b35 Author: QuzarDC <qu...@co...> Date: Tue Mar 5 07:09:36 2024 -0500 Reimplement aliases commit 8e103815db2de84d171be9a0b92e854359ac4601 Author: QuzarDC <qu...@co...> Date: Tue Mar 5 01:50:08 2024 -0500 Add rewinddir and test it commit 3a5ea762b0f257180bd980a435eb17ada53026e9 Author: QuzarDC <qu...@co...> Date: Tue Mar 5 01:00:00 2024 -0500 Clean up whitespace commit 842a0c489904997f6872725a18919557dda1e919 Author: QuzarDC <qu...@co...> Date: Tue Mar 5 00:47:12 2024 -0500 Rebuild /dev/ to accept other devs ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + examples/dreamcast/{libdream => dev}/Makefile | 5 +- .../dreamcast/{random => dev/devroot}/Makefile | 6 +- examples/dreamcast/dev/devroot/devroot.c | 62 ++++ examples/dreamcast/{ => dev}/random/Makefile | 0 examples/dreamcast/{ => dev}/random/random.c | 0 .../dreamcast/parallax/serpent_dma/perfmeter.c | 10 +- examples/dreamcast/parallax/serpent_dma/serpent.c | 12 +- include/kos/fs_dev.h | 20 +- include/kos/fs_null.h | 44 +++ include/kos/{fs_dev.h => fs_random.h} | 20 +- include/kos/nmmgr.h | 27 +- include/sys/dirent.h | 10 +- kernel/arch/dreamcast/hardware/maple/keyboard.c | 19 +- kernel/arch/dreamcast/hardware/modem/mdata.c | 1 + kernel/arch/dreamcast/hardware/pvr/pvr_internal.h | 26 +- kernel/arch/dreamcast/hardware/pvr/pvr_misc.c | 75 +++-- kernel/arch/dreamcast/include/dc/maple/keyboard.h | 4 +- kernel/arch/dreamcast/include/dc/matrix.h | 7 +- .../dreamcast/include/dc/net/broadband_adapter.h | 2 +- kernel/arch/dreamcast/include/dc/pvr.h | 20 +- kernel/arch/dreamcast/include/dc/sq.h | 2 - kernel/arch/dreamcast/include/dc/video.h | 2 +- kernel/arch/dreamcast/kernel/init.c | 8 +- kernel/arch/dreamcast/kernel/initall_hdrs.h | 2 + kernel/arch/dreamcast/sound/snd_stream.c | 1 + kernel/exports/nmmgr.c | 7 +- kernel/fs/Makefile | 3 +- kernel/fs/fs.c | 3 + kernel/fs/fs_dev.c | 326 +++++---------------- kernel/fs/fs_null.c | 272 +++++++++++++++++ kernel/fs/{fs_dev.c => fs_random.c} | 174 ++++++----- kernel/libc/koslib/readdir.c | 2 +- kernel/libc/koslib/realpath.c | 5 + kernel/thread/sem.c | 1 + 35 files changed, 722 insertions(+), 457 deletions(-) copy examples/dreamcast/{libdream => dev}/Makefile (86%) copy examples/dreamcast/{random => dev/devroot}/Makefile (90%) create mode 100644 examples/dreamcast/dev/devroot/devroot.c rename examples/dreamcast/{ => dev}/random/Makefile (100%) rename examples/dreamcast/{ => dev}/random/random.c (100%) create mode 100644 include/kos/fs_null.h copy include/kos/{fs_dev.h => fs_random.h} (75%) create mode 100644 kernel/fs/fs_null.c copy kernel/fs/{fs_dev.c => fs_random.c} (60%) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d4801fa1..0850517e 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -220,6 +220,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Implemented scandir() and alphasort() POSIX functions from dirent.h [FG] - DC Added new driver for the SH4's UBC + high-level breakpoint API [FG] - DC Add support for French AZERTY keyboards [PC] +- DC Increased the resolution of pvr_stats_t from milli to nanoseconds [FG] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/examples/dreamcast/libdream/Makefile b/examples/dreamcast/dev/Makefile similarity index 86% copy from examples/dreamcast/libdream/Makefile copy to examples/dreamcast/dev/Makefile index b32976d1..6e2aafa0 100644 --- a/examples/dreamcast/libdream/Makefile +++ b/examples/dreamcast/dev/Makefile @@ -1,10 +1,7 @@ # This will make all the examples, leaving only the elf files. # If you want to clean everything, use 'clean'. -SUBDIRS = 320x240 640x480 rgb888 ta -SUBDIRS += cdfs -SUBDIRS += spu -SUBDIRS += keyboard mouse lcd vmu +SUBDIRS = devroot random all: $(patsubst %, _dir_%, $(SUBDIRS)) diff --git a/examples/dreamcast/random/Makefile b/examples/dreamcast/dev/devroot/Makefile similarity index 90% copy from examples/dreamcast/random/Makefile copy to examples/dreamcast/dev/devroot/Makefile index 251e4da8..9dca03e6 100644 --- a/examples/dreamcast/random/Makefile +++ b/examples/dreamcast/dev/devroot/Makefile @@ -4,12 +4,10 @@ # # Put the filename of the output binary here -TARGET = random.elf +TARGET = devroot.elf # List all of your C files here, but change the extension to ".o" -OBJS = random.o - -KOS_CFLAGS += -std=c99 +OBJS = devroot.o # The rm-elf step is to remove the target before building, to force the # re-creation of the rom disk. diff --git a/examples/dreamcast/dev/devroot/devroot.c b/examples/dreamcast/dev/devroot/devroot.c new file mode 100644 index 00000000..8e4ea5e1 --- /dev/null +++ b/examples/dreamcast/dev/devroot/devroot.c @@ -0,0 +1,62 @@ +/* KallistiOS ##version## + + devroot.c + Copyright (C) 2024 Donald Haase + + This example demonstrates the expected behavior of reading from the + / and /dev dirs, as well as attempting to open a non-existant device + for the same. +*/ + +#include <kos.h> +#include <errno.h> +#include <dirent.h> + +KOS_INIT_FLAGS(INIT_DEFAULT); + +/* This tests readdir and rewinddir by printing a list of all entries, +then rewinding and counting that the same number of entries are present */ +void printdir(char* fn) { + DIR *d; + struct dirent *entry; + int cnt1 = 0, cnt2 = 0; + + if(!(d = opendir(fn))) { + printf("Could not open %s: %s\n", fn, strerror(errno)); + } + else { + printf("Opened %s and found these: \n", fn); + while((entry = readdir(d))) { + printf(" %s\n", entry->d_name); + cnt1++; + } + + printf("Rewinding %s to loop again.\n", fn); + rewinddir(d); + + while((entry = readdir(d))) { + cnt2++; + } + + if(cnt1 == cnt2) { + printf("PASS: Counted %i entries both times.\n", cnt1); + } + else + printf("FAIL: Counted %i entries the first time and %i the second.\n", cnt1, cnt2); + } +} + +int main(int argc, char **argv) { + + /* Open the root of dev's filesystem and list the contents. */ + /* This should *not* show /dev subdirs */ + printdir("/"); + + /* Now do the same with /dev. This should list out the devices under it. */ + printdir("/dev"); + + /* Now try the same with a fake dev. It should fail */ + printdir("/dev/quzar"); + + return 0; +} diff --git a/examples/dreamcast/random/Makefile b/examples/dreamcast/dev/random/Makefile similarity index 100% rename from examples/dreamcast/random/Makefile rename to examples/dreamcast/dev/random/Makefile diff --git a/examples/dreamcast/random/random.c b/examples/dreamcast/dev/random/random.c similarity index 100% rename from examples/dreamcast/random/random.c rename to examples/dreamcast/dev/random/random.c diff --git a/examples/dreamcast/parallax/serpent_dma/perfmeter.c b/examples/dreamcast/parallax/serpent_dma/perfmeter.c index c85bb1d7..8eeca655 100644 --- a/examples/dreamcast/parallax/serpent_dma/perfmeter.c +++ b/examples/dreamcast/parallax/serpent_dma/perfmeter.c @@ -47,7 +47,7 @@ void pm_draw(void) { pvr_list_begin(PVR_LIST_TR_POLY); // Make a nice stat display - sprintf(str, "fps %.2f buf %d reg %d rnd %d", + sprintf(str, "fps: %.2f buf: %lluns reg: %lluns rnd: %lluns", (double)stats.frame_rate, stats.buf_last_time, stats.reg_last_time, @@ -59,7 +59,7 @@ void pm_draw(void) { plx_fcxt_draw(fcxt, str); plx_fcxt_end(fcxt); - sprintf(str, "avg fps %.2f", + sprintf(str, "avg fps: %.2f", (double)(60.0 * stats.frame_count / stats.vbl_count)); plx_fcxt_setpos(fcxt, posx, posy + 16.0f, posz); plx_fcxt_begin(fcxt); @@ -72,15 +72,15 @@ void pm_draw(void) { posy += -40.0f; - pct = ((float)stats.buf_last_time) * 60.0f / 1000.0f; + pct = ((float)stats.buf_last_time) * 60.0f / 1000000000.0f; pm_drawbar(pct, posx, posy, posz, 0xff00c0c0, 0xff007070); - pct = ((float)stats.reg_last_time) * 60.0f / 1000.0f; + pct = ((float)stats.reg_last_time) * 60.0f / 1000000000.0f; posy += 8.0f; pm_drawbar(pct, posx, posy, posz, 0xff00c000, 0xff007000); // Draw a bargraph for rendering time - pct = ((float)stats.rnd_last_time) * 60.0f / 1000.0f; + pct = ((float)stats.rnd_last_time) * 60.0f / 1000000000.0f; posy += 8.0f; pm_drawbar(pct, posx, posy, posz, 0xffc0c000, 0xff707000); diff --git a/examples/dreamcast/parallax/serpent_dma/serpent.c b/examples/dreamcast/parallax/serpent_dma/serpent.c index 741513f3..4d3fa65a 100644 --- a/examples/dreamcast/parallax/serpent_dma/serpent.c +++ b/examples/dreamcast/parallax/serpent_dma/serpent.c @@ -2,13 +2,14 @@ KallistiOS ##version## serpent.c - Copyright (C)2002,2004 Megan Potter - Copyright (C)2004 Jim Ursetto + Copyright (C) 2002,2004 Megan Potter + Copyright (C) 2004 Jim Ursetto */ #include <kos.h> #include <math.h> #include <assert.h> +#include <stdlib.h> #include <plx/matrix.h> #include <plx/prim.h> #include <plx/context.h> @@ -274,9 +275,6 @@ int main(int argc, char **argv) { pvr_set_vertbuf(PVR_LIST_OP_POLY, dmabuffers[0], 4 * 1024 * 1024); pvr_set_vertbuf(PVR_LIST_TR_POLY, dmabuffers[1], 4 * 1024 * 1024); - // Escape hatch - cont_btn_callback(0, CONT_START | CONT_A, (cont_btn_callback_t)arch_exit); - /* Init matrices */ plx_mat3d_init(); plx_mat3d_mode(PLX_MAT_PROJECTION); @@ -292,8 +290,8 @@ int main(int argc, char **argv) { do_sphere_test(); pvr_get_stats(&stats); - dbglog(DBG_DEBUG, "3D Stats: %ld vblanks, frame rate ~%f fps, max vertex used %d bytes\n", - stats.vbl_count, (double)stats.frame_rate, stats.vtx_buffer_used_max); + dbglog(DBG_DEBUG, "3D Stats: %u vblanks, frame rate ~%f fps, max vertex used %u bytes\n", + stats.vbl_count, stats.frame_rate, stats.vtx_buffer_used_max); return 0; } diff --git a/include/kos/fs_dev.h b/include/kos/fs_dev.h index a0ec062a..09ce4ad0 100644 --- a/include/kos/fs_dev.h +++ b/include/kos/fs_dev.h @@ -1,25 +1,19 @@ /* KallistiOS ##version## kos/fs_dev.h - (c)2023 - Luke Benstead + Copyright (C) 2024 Donald Haase */ /** \file kos/fs_dev.h - \brief Driver for /dev/random and /dev/urandom. + \brief Container for /dev. \ingroup vfs_dev - This filesystem driver provides implementations of /dev/random - and /dev/urandom for portability. It seeds randomness from - uninitialized memory, and the clock. Obviously we - are limited in how we can provide sufficient entropy on an - embedded platform like the Dreamcast so the randomness from - this driver will not win any awards but it should be sufficiently - good for most purposes. + This is a thin filesystem that allows the /dev folder + and its contents to be read/listed as well new devices + to be added under it. - /dev/random is an alias to /dev/urandom for now. - - \author Luke Benstead + \author Donald Haase */ #ifndef __DC_FS_DEV_H @@ -31,7 +25,7 @@ __BEGIN_DECLS #include <kos/fs.h> /** \defgroup vfs_dev Dev - \brief VFS driver for /dev/random and /dev/urandom + \brief VFS driver for /dev \ingroup vfs @{ diff --git a/include/kos/fs_null.h b/include/kos/fs_null.h new file mode 100644 index 00000000..5151f64e --- /dev/null +++ b/include/kos/fs_null.h @@ -0,0 +1,44 @@ +/* KallistiOS ##version## + + kos/fs_null.h + Copyright (C) 2024 Donald Haase + +*/ + +/** \file kos/fs_null.h + \brief /dev/null, a black hole. + \ingroup vfs_dev + + This is a IEEE Std 1003.1-2017 POSIX standard + 'empty data source and infinite data sink' + + \author Donald Haase +*/ + +#ifndef __DC_FS_NULL_H +#define __DC_FS_NULL_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <kos/fs.h> + +/** \defgroup vfs_null /dev/null + \brief VFS driver for /dev/null + \ingroup vfs + + @{ +*/ + +/* \cond */ +/* Initialization */ +int fs_null_init(void); +int fs_null_shutdown(void); +/* \endcond */ + +/** @} */ + +__END_DECLS + +#endif /* __DC_FS_NULL_H */ + diff --git a/include/kos/fs_dev.h b/include/kos/fs_random.h similarity index 75% copy from include/kos/fs_dev.h copy to include/kos/fs_random.h index a0ec062a..e06b1017 100644 --- a/include/kos/fs_dev.h +++ b/include/kos/fs_random.h @@ -1,13 +1,13 @@ /* KallistiOS ##version## - kos/fs_dev.h - (c)2023 - Luke Benstead + kos/fs_random.h + Copyright (C) 2023 Luke Benstead */ -/** \file kos/fs_dev.h +/** \file kos/fs_random.h \brief Driver for /dev/random and /dev/urandom. - \ingroup vfs_dev + \ingroup vfs_rnd This filesystem driver provides implementations of /dev/random and /dev/urandom for portability. It seeds randomness from @@ -22,15 +22,15 @@ \author Luke Benstead */ -#ifndef __DC_FS_DEV_H -#define __DC_FS_DEV_H +#ifndef __DC_FS_RANDOM_H +#define __DC_FS_RANDOM_H #include <sys/cdefs.h> __BEGIN_DECLS #include <kos/fs.h> -/** \defgroup vfs_dev Dev +/** \defgroup vfs_rnd Random \brief VFS driver for /dev/random and /dev/urandom \ingroup vfs @@ -39,13 +39,13 @@ __BEGIN_DECLS /* \cond */ /* Initialization */ -int fs_dev_init(void); -int fs_dev_shutdown(void); +int fs_rnd_init(void); +int fs_rnd_shutdown(void); /* \endcond */ /** @} */ __END_DECLS -#endif /* __DC_FS_DEV_H */ +#endif /* __DC_FS_RANDOM_H */ diff --git a/include/kos/nmmgr.h b/include/kos/nmmgr.h index 9373444a..5e512f6e 100644 --- a/include/kos/nmmgr.h +++ b/include/kos/nmmgr.h @@ -60,13 +60,28 @@ typedef LIST_HEAD(nmmgr_list, nmmgr_handler) nmmgr_list_t; */ typedef struct nmmgr_handler { char pathname[NAME_MAX]; /* Path name */ - int pid; /* Process table ID for handler (0 == static) */ + int pid; /* Process table ID for handler (0 == static) */ uint32 version; /* Version code */ uint32 flags; /* Bitmask of flags */ uint32 type; /* Type of handler */ LIST_ENTRY(nmmgr_handler) list_ent; /* Linked list entry */ } nmmgr_handler_t; +/** \brief Alias handler interface. + \ingroup system_namemgr + + The smallest possible extension of name handler, it has its own name + but holds a pointer to a full handler of the appropriate type. This + prevents the need to duplicate large vfs structures. + +*/ +typedef struct alias_handler { + /** \brief Name manager handler header */ + nmmgr_handler_t nmmgr; + + nmmgr_handler_t *alias; +} alias_handler_t; + /* Version codes ('version') have two pieces: a major and minor revision. A major revision (top 16 bits) means that the interfaces are totally incompatible. A minor revision (lower 16 bits) diffrentiates between @@ -78,6 +93,16 @@ typedef struct nmmgr_handler { */ #define NMMGR_FLAGS_NEEDSFREE 0x00000001 +/** \brief This structure maps into /dev/. + \ingroup system_namemgr +*/ +#define NMMGR_FLAGS_INDEV 0x00000002 + +/** \brief This structure aliases another. + \ingroup system_namemgr +*/ +#define NMMGR_FLAGS_ALIAS 0x00000004 + /** \defgroup nmmgr_types Handler Types \brief Name handler types \ingroup system_namemgr diff --git a/include/sys/dirent.h b/include/sys/dirent.h index 77595bd4..7951c390 100644 --- a/include/sys/dirent.h +++ b/include/sys/dirent.h @@ -62,11 +62,11 @@ __BEGIN_DECLS \headerfile sys/dirent.h */ struct dirent { - int d_ino; /**< \brief File unique identifier. */ - off_t d_off; /**< \brief File offset */ - uint16_t d_reclen; /**< \brief Record length */ - uint8_t d_type; /**< \brief File type */ - char d_name[0]; /**< \brief Filename */ + int d_ino; /**< \brief File unique identifier. */ + off_t d_off; /**< \brief File offset */ + uint16_t d_reclen; /**< \brief Record length */ + uint8_t d_type; /**< \brief File type */ + char d_name[0]; /**< \brief Filename */ }; /** \brief Type representing a directory stream. diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index 9137ecc8..1162c6db 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -379,7 +379,10 @@ void kbd_set_queue(int active) { } /* Take a key scancode, encode it appropriately, and place it on the - keyboard queue. At the moment we assume no key overflows. */ + keyboard queue. At the moment we assume no key overflows. + + NOTE: We are only calling this within an IRQ context, so operations on + kbd_state::queue_size are essentially atomic. */ static int kbd_enqueue(kbd_state_t *state, uint8 keycode, int mods) { static char keymap_noshift[] = { /*0*/ 0, 0, 0, 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', @@ -410,10 +413,10 @@ static int kbd_enqueue(kbd_state_t *state, uint8 keycode, int mods) { return 0; /* Queue the key up on the device-specific queue. */ - if(atomic_load(&state->queue_len) < KBD_QUEUE_SIZE) { + if(state->queue_len < KBD_QUEUE_SIZE) { state->key_queue[state->queue_head] = keycode | (mods << 8); state->queue_head = (state->queue_head + 1) & (KBD_QUEUE_SIZE - 1); - atomic_fetch_add(&state->queue_len, 1); + ++state->queue_len; ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2024-04-26 03:04: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 "UNNAMED PROJECT". The branch, master has been updated via cda50655f8870af22a23afe4c57aa0e5b60073d1 (commit) via 76adea07c4a44081bfa6804be336e2c7d34d8f3a (commit) from e6229e496119a7665714109a0f2139f9a04661da (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 cda50655f8870af22a23afe4c57aa0e5b60073d1 Merge: e6229e4 76adea0 Author: Lawrence Sebald <ljs...@us...> Date: Thu Apr 25 23:02:22 2024 -0400 Merge pull request #1 from KallistiOS/Explicit_func Properly prototype sndmp3_ functions commit 76adea07c4a44081bfa6804be336e2c7d34d8f3a Author: QuzarDC <qu...@co...> Date: Sat Feb 10 16:56:59 2024 -0500 Properly prototype sndmp3_ functions ----------------------------------------------------------------------- Summary of changes: include/sndmp3.h | 11 +++++++++-- libmp3/main.c | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/sndmp3.h b/include/sndmp3.h index b0da7f5..42162b4 100644 --- a/include/sndmp3.h +++ b/include/sndmp3.h @@ -10,18 +10,25 @@ #include <sys/cdefs.h> __BEGIN_DECLS -int sndmp3_init(const char *fn, int loop); +/* Wait until the MP3 thread is started and ready */ +void sndmp3_wait_start(void); /* Initialize the MP3 driver; takes an input filename and starts the decoding process. */ int sndmp3_start(const char *fn, int loop); +/* Stop playback (implies song unload) */ +void sndmp3_stop(void); + /* Shut everything down */ -void sndmp3_shutdown(); +void sndmp3_shutdown(void); /* Controls volume of MP3 stream */ void sndmp3_volume(int vol); +/* The main loop for the sound server */ +void sndmp3_mainloop(void); + __END_DECLS #endif /* __SNDMP3_H */ diff --git a/libmp3/main.c b/libmp3/main.c index 118b80f..3008837 100644 --- a/libmp3/main.c +++ b/libmp3/main.c @@ -6,6 +6,7 @@ */ #include <kos.h> +#include "sndmp3.h" void *sndserver_thread(void *blagh) { printf("sndserver: started [DEBUG]\r\n"); hooks/post-receive -- UNNAMED PROJECT |
From: ljsebald <ljs...@us...> - 2024-04-26 03:04:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "UNNAMED PROJECT". The branch, master has been updated via 5cea4ada7069a372423734cbc9a94ae689c7601e (commit) via f90e3924ddada080e579e87b16d262990285015b (commit) from cc2753766191bb3f9969d0b0b659362b001594a1 (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 5cea4ada7069a372423734cbc9a94ae689c7601e Merge: cc27537 f90e392 Author: Lawrence Sebald <ljs...@us...> Date: Thu Apr 25 23:03:05 2024 -0400 Merge pull request #1 from Dreamcast-Projects/master Fix liboggvorbisplay warnings commit f90e3924ddada080e579e87b16d262990285015b Author: Andress Barajas <and...@gm...> Date: Tue Apr 23 20:09:23 2024 -0700 Fix warnings Fix additional warnings Final Fix include error Meh Last test ----------------------------------------------------------------------- Summary of changes: include/oggvorbis/sndoggvorbis.h | 48 ++++++++++++++++++------------------- liboggvorbisplay/main.c | 2 ++ liboggvorbisplay/sndoggvorbis.c | 51 +++++++++++++++++++--------------------- 3 files changed, 50 insertions(+), 51 deletions(-) diff --git a/include/oggvorbis/sndoggvorbis.h b/include/oggvorbis/sndoggvorbis.h index ecf7428..62cda20 100644 --- a/include/oggvorbis/sndoggvorbis.h +++ b/include/oggvorbis/sndoggvorbis.h @@ -15,37 +15,37 @@ __BEGIN_DECLS #include <stdio.h> -int sndoggvorbis_init(); -int sndoggvorbis_start(const char *filename,int loop); +int sndoggvorbis_init(void); +int sndoggvorbis_start(const char *filename,int loop); int sndoggvorbis_start_fd(FILE *f, int loop); -void sndoggvorbis_stop(); -void sndoggvorbis_shutdown(); - -int sndoggvorbis_isplaying(); - -void sndoggvorbis_volume(int vol); - -void sndoggvorbis_mainloop(); -void sndoggvorbis_wait_start(); - -void sndoggvorbis_setbitrateinterval(int interval); -long sndoggvorbis_getbitrate(); -long sndoggvorbis_getposition(); - -char *sndoggvorbis_getcommentbyname(const char *commentfield); -char *sndoggvorbis_getartist(); -char *sndoggvorbis_gettitle(); -char *sndoggvorbis_getgenre(); +void sndoggvorbis_stop(void); +void sndoggvorbis_shutdown(void); + +int sndoggvorbis_isplaying(void); + +void sndoggvorbis_volume(int vol); + +void sndoggvorbis_mainloop(void); +void sndoggvorbis_wait_start(void); + +void sndoggvorbis_setbitrateinterval(int interval); +long sndoggvorbis_getbitrate(void); +long sndoggvorbis_getposition(void); + +char *sndoggvorbis_getcommentbyname(const char *commentfield); +char *sndoggvorbis_getartist(void); +char *sndoggvorbis_gettitle(void); +char *sndoggvorbis_getgenre(void); /* Enable/disable queued waiting */ -void sndoggvorbis_queue_enable(); -void sndoggvorbis_queue_disable(); +void sndoggvorbis_queue_enable(void); +void sndoggvorbis_queue_disable(void); /* Wait for the song to be queued */ -void sndoggvorbis_queue_wait(); +void sndoggvorbis_queue_wait(void); /* Queue the song to start if it's in QUEUED */ -void sndoggvorbis_queue_go(); +void sndoggvorbis_queue_go(void); __END_DECLS diff --git a/liboggvorbisplay/main.c b/liboggvorbisplay/main.c index 605c8a2..c38d08c 100644 --- a/liboggvorbisplay/main.c +++ b/liboggvorbisplay/main.c @@ -1,5 +1,7 @@ #include <kos.h> +#include "oggvorbis/sndoggvorbis.h" + static kthread_t * thd = NULL; static void *sndserver_thread(void *blagh) { diff --git a/liboggvorbisplay/sndoggvorbis.c b/liboggvorbisplay/sndoggvorbis.c index 522ece5..2de17e0 100644 --- a/liboggvorbisplay/sndoggvorbis.c +++ b/liboggvorbisplay/sndoggvorbis.c @@ -3,14 +3,13 @@ * * sndoggvorbis.c * Copyright (C)2001,2002 Thorsten Titze - * Copyright (C)2002,2003,2004 Dan Potter + * Copyright (C)2002,2003,2004 Megan Potter * * An Ogg/Vorbis player library using sndstream and functions provided by * ivorbisfile (Tremor). */ #include <kos.h> -/* #include <sndserver.h> */ #include <assert.h> #include <vorbis/vorbisfile.h> #include "misc.h" @@ -61,42 +60,40 @@ static int sndoggvorbis_queue_enabled; /* wait in STATUS_QUEUED? */ static volatile int sndoggvorbis_loop; /* current looping mode */ static volatile int sndoggvorbis_status; /* current status of thread */ static volatile int sndoggvorbis_bitrateint; /* bitrateinterval in calls */ -static semaphore_t *sndoggvorbis_halt_sem; /* semaphore to pause thread */ +static semaphore_t sndoggvorbis_halt_sem; /* semaphore to pause thread */ static char sndoggvorbis_lastfilename[256]; /* filename of last played file */ static int current_section; static int sndoggvorbis_vol = 240; /* Enable/disable queued waiting */ -void sndoggvorbis_queue_enable() { +void sndoggvorbis_queue_enable(void) { sndoggvorbis_queue_enabled = 1; } -void sndoggvorbis_queue_disable() { +void sndoggvorbis_queue_disable(void) { sndoggvorbis_queue_enabled = 0; } /* Wait for the song to be queued */ -void sndoggvorbis_queue_wait() { - assert(sndoggvorbis_queue_wait); - +void sndoggvorbis_queue_wait(void) { /* Make sure we've loaded ok */ while (sndoggvorbis_status != STATUS_QUEUED) thd_pass(); } /* Queue the song to start if it's in QUEUED */ -void sndoggvorbis_queue_go() { +void sndoggvorbis_queue_go(void) { /* Make sure we're ready */ sndoggvorbis_queue_wait(); /* Tell it to go */ sndoggvorbis_status = STATUS_STARTING; - sem_signal(sndoggvorbis_halt_sem); + sem_signal(&sndoggvorbis_halt_sem); } /* getter and setter functions for information access */ -int sndoggvorbis_isplaying() +int sndoggvorbis_isplaying(void) { if((sndoggvorbis_status == STATUS_PLAYING) || (sndoggvorbis_status == STATUS_STARTING) || @@ -125,13 +122,13 @@ void sndoggvorbis_setbitrateinterval(int interval) * NOTE: * The value returned is only actualized every once in a while ! */ -long sndoggvorbis_getbitrate() +long sndoggvorbis_getbitrate(void) { return(sndoggvorbis_info.actualbitrate); // return(VorbisFile_getBitrateInstant()); } -long sndoggvorbis_getposition() +long sndoggvorbis_getposition(void) { return(sndoggvorbis_info.actualposition); } @@ -140,15 +137,15 @@ long sndoggvorbis_getposition() * fields. It is thinkable that these return something like "NOT SET" * in case the specified field has not been set ! */ -char *sndoggvorbis_getartist() +char *sndoggvorbis_getartist(void) { return(sndoggvorbis_info.artist); } -char *sndoggvorbis_gettitle() +char *sndoggvorbis_gettitle(void) { return(sndoggvorbis_info.title); } -char *sndoggvorbis_getgenre() +char *sndoggvorbis_getgenre(void) { return(sndoggvorbis_info.genre); } @@ -189,7 +186,7 @@ static void sndoggvorbis_clear_comments() { * let's the caller wait until the vorbis thread is signalling that it is ready * to decode data */ -void sndoggvorbis_wait_start() +void sndoggvorbis_wait_start(void) { while(sndoggvorbis_status != STATUS_READY) thd_pass(); @@ -292,7 +289,7 @@ static void *callback(snd_stream_hnd_t hnd, int size, int * size_out) * this function is called by sndoggvorbis_mainloop and handles all the threads * status handling and playing functionality. */ -void sndoggvorbis_thread() +void sndoggvorbis_thread(void) { int stat; @@ -309,7 +306,7 @@ void sndoggvorbis_thread() case STATUS_READY: printf("oggthread: waiting on semaphore\n"); - sem_wait(sndoggvorbis_halt_sem); + sem_wait(&sndoggvorbis_halt_sem); printf("oggthread: released from semaphore (status=%d)\n", sndoggvorbis_status); break; @@ -329,7 +326,7 @@ void sndoggvorbis_thread() case STATUS_QUEUED: printf("oggthread: queue waiting on semaphore\n"); - sem_wait(sndoggvorbis_halt_sem); + sem_wait(&sndoggvorbis_halt_sem); printf("oggthread: queue released from semaphore\n"); break; @@ -417,7 +414,7 @@ void sndoggvorbis_thread() * function to stop the current playback and set the thread back to * STATUS_READY mode. */ -void sndoggvorbis_stop() +void sndoggvorbis_stop(void) { if (sndoggvorbis_status != STATUS_PLAYING && sndoggvorbis_status != STATUS_STARTING @@ -492,7 +489,7 @@ int sndoggvorbis_start_fd(FILE * fd, int loop) sndoggvorbis_status = STATUS_QUEUEING; else sndoggvorbis_status = STATUS_STARTING; - sem_signal(sndoggvorbis_halt_sem); + sem_signal(&sndoggvorbis_halt_sem); /* Grab all standard comments from the file * (based on v-comment.html found in OggVorbis source packages @@ -539,12 +536,12 @@ int sndoggvorbis_start(const char *filename,int loop) * * function that stops playing and shuts down the player thread. */ -void sndoggvorbis_thd_quit() +void sndoggvorbis_thd_quit(void) { sndoggvorbis_status = STATUS_QUIT; /* In case player is READY -> tell it to continue */ - sem_signal(sndoggvorbis_halt_sem); + sem_signal(&sndoggvorbis_halt_sem); while (sndoggvorbis_status != STATUS_ZOMBIE) thd_pass(); // snd_stream_stop(); @@ -565,11 +562,11 @@ void sndoggvorbis_volume(int vol) * code that runs in our decoding thread. sets up the semaphore. initializes the stream * driver and calls our *real* thread code */ -void sndoggvorbis_mainloop() +void sndoggvorbis_mainloop(void) { /* create a semaphore for thread to halt on */ - sndoggvorbis_halt_sem = sem_create(0); + sem_init(&sndoggvorbis_halt_sem, 0); sndoggvorbis_status = STATUS_INIT; sndoggvorbis_queue_enabled = 0; @@ -585,5 +582,5 @@ void sndoggvorbis_mainloop() /* destroy the semaphore we first created */ - sem_destroy(sndoggvorbis_halt_sem); + sem_destroy(&sndoggvorbis_halt_sem); } hooks/post-receive -- UNNAMED PROJECT |
From: falcovorbis <fal...@us...> - 2024-04-23 07:01: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 1ff6f043444446a09d55e464fd9a73be5307c740 (commit) from 5ae615b8c20b78cab7485856a6d8f541c331c089 (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 1ff6f043444446a09d55e464fd9a73be5307c740 Author: Paul Cercueil <pa...@cr...> Date: Tue Apr 23 06:25:57 2024 +0200 cmake: Simplify toolchain script (#501) * cmake: Simplify toolchain script Instead of duplicating all the CFLAGS and LDFLAGS that should be set by the user in the environ*.sh scripts, use the KOS wrappers as the compilers, which makes sure that the user flags are used by default. Signed-off-by: Paul Cercueil <pa...@cr...> * dreamcast.cmake work to support new toolchain * Added subarch-specific defines to build env - __DREAMCAST__ - __NAOMI__ * Update dreamcast.cmake Fixing typo! * Added config variables to dreamcast.cmake 1) Changed all references to $ENV{KOS_XXX} to just KOS_XXX 2) Either inherits KOS_XXX variables from KOS toolchain file, looks for them in the environment, or errors out --------- Signed-off-by: Paul Cercueil <pa...@cr...> Co-authored-by: Falco Girgis <gyr...@gm...> ----------------------------------------------------------------------- Summary of changes: environ_dreamcast.sh | 2 + utils/cmake/dreamcast.cmake | 70 ++++++++++++------------ utils/cmake/dreamcast.toolchain.cmake | 100 +++++++--------------------------- 3 files changed, 56 insertions(+), 116 deletions(-) diff --git a/environ_dreamcast.sh b/environ_dreamcast.sh index 7108f2cd..50551209 100644 --- a/environ_dreamcast.sh +++ b/environ_dreamcast.sh @@ -10,9 +10,11 @@ export KOS_CFLAGS="${KOS_CFLAGS} ${KOS_SH4_PRECISION} -ml -ffunction-sections -f export KOS_AFLAGS="${KOS_AFLAGS} -little" if [ x${KOS_SUBARCH} = xnaomi ]; then + export KOS_CFLAGS="${KOS_CFLAGS} -D__NAOMI__" export KOS_LDFLAGS="${KOS_LDFLAGS} ${KOS_SH4_PRECISION} -ml -Wl,-Ttext=0x8c020000 -Wl,--gc-sections" export KOS_LD_SCRIPT="-T${KOS_BASE}/utils/ldscripts/shlelf-naomi.xc" else + export KOS_CFLAGS="${KOS_CFLAGS} -D__DREAMCAST__" export KOS_LDFLAGS="${KOS_LDFLAGS} ${KOS_SH4_PRECISION} -ml -Wl,-Ttext=0x8c010000 -Wl,--gc-sections" export KOS_LD_SCRIPT="-T${KOS_BASE}/utils/ldscripts/shlelf.xc" fi diff --git a/utils/cmake/dreamcast.cmake b/utils/cmake/dreamcast.cmake index 4fff3a9c..0a30e304 100644 --- a/utils/cmake/dreamcast.cmake +++ b/utils/cmake/dreamcast.cmake @@ -1,6 +1,35 @@ +# Auxiliary CMake Utility Functions +# Copyright (C) 2023 Colton Pawielski +# Copyright (C) 2024 Falco Girgis +# +# This file implements utilities for the following additional functionality +# which exists in the KOS Make build system: +# 1) linking to existing binaries +# 2) adding a romdisk +# +# NOTE: When using the KOS CMake toolchain file, you do not need to include +# this file directly! + ### This minimum is based on the minimum requirement in dreamcast.toolchain.cmake cmake_minimum_required(VERSION 3.13) +#### Set Configuration Variables From Environment (if Necessary) #### +if(NOT DEFINED KOS_BASE) + if(NOT DEFINED ENV{KOS_BASE}) + message(FATAL_ERROR "KOS_BASE environment variable not found!") + else() + set(KOS_BASE $ENV{KOS_BASE}) + endif() +endif() + +if(NOT DEFINED KOS_CC_BASE) + if(NOT DEFINED ENV{KOS_CC_BASE}) + message(FATAL_ERROR "KOS_CC_BASE environment variable not found!") + else() + set(KOS_CC_BASE $ENV{KOS_CC_BASE}) + endif() +endif() + ### Helper Function for Bin2Object ### function(kos_bin2o inFile symbol) # outFile is optional and defaults to the symbol name in the build directory @@ -14,13 +43,14 @@ function(kos_bin2o inFile symbol) add_custom_command( OUTPUT ${outFile} DEPENDS ${inFile} - COMMAND $ENV{KOS_BASE}/utils/bin2o/bin2o ${inFile} ${symbol} ${outFile} + COMMAND ${KOS_BASE}/utils/bin2o/bin2o ${inFile} ${symbol} ${outFile} ) endfunction() function(kos_add_binary target inFile symbol) + file(REAL_PATH "${inFile}" inFile) set(outFile ${CMAKE_CURRENT_BINARY_DIR}/${symbol}.o) - kos_bin2o(${CMAKE_CURRENT_SOURCE_DIR}/${inFile} ${symbol} ${outFile}) + kos_bin2o(${inFile} ${symbol} ${outFile}) target_sources(${target} PRIVATE ${outFile}) endfunction() @@ -33,7 +63,7 @@ function(kos_add_romdisk target romdiskPath) set(romdiskName ${ARGN}) endif() - set(romdiskPath ${CMAKE_CURRENT_SOURCE_DIR}/${romdiskPath}) + file(REAL_PATH "${romdiskPath}" romdiskPath) set(obj ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}.o) set(obj_tmp ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}_tmp.o) @@ -52,7 +82,7 @@ function(kos_add_romdisk target romdiskPath) add_custom_command( OUTPUT ${img} DEPENDS ${romdiskFiles} - COMMAND $ENV{KOS_BASE}/utils/genromfs/genromfs -f ${img} -d ${romdiskPath} -v + COMMAND ${KOS_BASE}/utils/genromfs/genromfs -f ${img} -d ${romdiskPath} -v ) kos_bin2o(${img} ${romdiskName} ${obj_tmp}) @@ -61,40 +91,10 @@ function(kos_add_romdisk target romdiskPath) add_custom_command( OUTPUT ${obj} DEPENDS ${obj_tmp} - COMMAND ${CMAKE_C_COMPILER} -o ${obj} -r ${obj_tmp} -L$ENV{KOS_BASE}/lib/dreamcast -Wl,--whole-archive -lromdiskbase + COMMAND ${KOS_CC_BASE}/bin/sh-elf-gcc -o ${obj} -r ${obj_tmp} -L${KOS_BASE}/lib/dreamcast -Wl,--whole-archive -lromdiskbase COMMAND rm ${obj_tmp} ) # Append romdisk object to target target_sources(${target} PRIVATE ${obj}) endfunction() - -### Function to Enable SH4 Math Optimizations ### -function(kos_enable_sh4_math) - if(NOT ${PLATFORM_DREAMCAST}) - message(WARN " PLATFORM_DREAMCAST not set, skipping SH4 Math flags") - return() - endif() - - message(INFO " Enabling SH4 Math Optimizations") - add_compile_options(-ffast-math) - - # Check if -mfsrra and -mfsca are supported by the compiler - # They were added for GCC 4.8, so the Legacy GCC4.7 toolchain - # will complain if they are added. - include(CheckCCompilerFlag) - check_c_compiler_flag("-mfsrra" COMPILER_HAS_FSRRA) - check_c_compiler_flag("-mfsca" COMPILER_HAS_FSCA) - if(COMPILER_HAS_FSRRA) - add_compile_options(-mfsrra) - else() - message(WARN " Must have GCC4.8 or later for -mfsrra to be enabled") - endif() - - if(COMPILER_HAS_FSCA) - add_compile_options(-mfsca) - else() - message(WARN " Must have GCC4.8 or later for -mfsca to be enabled") - endif() - -endfunction() diff --git a/utils/cmake/dreamcast.toolchain.cmake b/utils/cmake/dreamcast.toolchain.cmake index 23071c9e..281c0e91 100644 --- a/utils/cmake/dreamcast.toolchain.cmake +++ b/utils/cmake/dreamcast.toolchain.cmake @@ -1,5 +1,8 @@ # CMake Toolchain file for targeting the Dreamcast or NAOMI with CMake. -# (c)2023 Falco Girgis, Luke Benstead +# Copyright (C) 2023 Luke Benstead +# Copyright (C) 2023, 2024 Falco Girgis +# Copyright (C) 2024 Donald Haase +# Copyright (C) 2024 Paul Cercueil # # This file is to be passed to CMake when compiling a regular CMake project # to cross-compile for the Dreamcast, using the KOS environment and settings. @@ -10,6 +13,10 @@ # # cmake /path/to/src -DCMAKE_TOOLCHAIN_FILE=${KOS_CMAKE_TOOLCHAIN} # +# or even: +# +# kos-cmake /path/to/src +# # Frame pointers are enabled in debug builds as these are required for # stack traces and GDB. They are disabled in release. # @@ -20,36 +27,16 @@ cmake_minimum_required(VERSION 3.13) #### Set Configuration Variables From Environment #### -if(NOT DEFINED KOS_BASE) - if(NOT DEFINED ENV{KOS_BASE}) - message(FATAL_ERROR "Variable KOS_BASE not set and was not found in the environment") - endif() +if(NOT DEFINED ENV{KOS_BASE} + OR NOT DEFINED ENV{KOS_CC_BASE} + OR NOT DEFINED ENV{KOS_SUBARCH} + OR NOT DEFINED ENV{KOS_PORTS}) + message(FATAL_ERROR "KallistiOS environment variables not found") +else() set(KOS_BASE $ENV{KOS_BASE}) - message(VERBOSE "KOS_BASE: ${KOS_BASE}") -endif() - -if(NOT DEFINED KOS_CC_BASE) - if(NOT DEFINED ENV{KOS_CC_BASE}) - message(FATAL_ERROR "Variable KOS_CC_BASE not set and was not found in the environment") - endif() set(KOS_CC_BASE $ENV{KOS_CC_BASE}) - message(VERBOSE "KOS_CC_BASE: ${KOS_CC_BASE}") -endif() - -if(NOT DEFINED KOS_SUBARCH) - if(NOT DEFINED ENV{KOS_SUBARCH}) - message(FATAL_ERROR "Variable KOS_SUBARCH not set and was not found in the environment") - endif() set(KOS_SUBARCH $ENV{KOS_SUBARCH}) - message(VERBOSE "KOS_SUBARCH: ${KOS_SUBARCH}") -endif() - -if(NOT DEFINED KOS_PORTS) - if(NOT DEFINED ENV{KOS_PORTS}) - message(FATAL_ERROR "Variable KOS_PORTS not set and was not found in the environment") - endif() set(KOS_PORTS $ENV{KOS_PORTS}) - message(VERBOSE "KOS_PORTS: ${KOS_PORTS}") endif() list(APPEND CMAKE_MODULE_PATH $ENV{KOS_BASE}/utils/cmake) @@ -63,11 +50,11 @@ set(PLATFORM_DREAMCAST TRUE) ##### Configure Cross-Compiler ##### set(CMAKE_CROSSCOMPILING TRUE) -set(CMAKE_ASM_COMPILER ${KOS_CC_BASE}/bin/sh-elf-as) -set(CMAKE_C_COMPILER ${KOS_CC_BASE}/bin/sh-elf-gcc) -set(CMAKE_CXX_COMPILER ${KOS_CC_BASE}/bin/sh-elf-g++) -set(CMAKE_OBJC_COMPILER ${KOS_CC_BASE}/bin/sh-elf-gcc) -set(CMAKE_OBJCXX_COMPILER ${KOS_CC_BASE}/bin/sh-elf-g++) +set(CMAKE_ASM_COMPILER ${KOS_BASE}/utils/gnu_wrappers/kos-as) +set(CMAKE_C_COMPILER ${KOS_BASE}/utils/gnu_wrappers/kos-cc) +set(CMAKE_CXX_COMPILER ${KOS_BASE}/utils/gnu_wrappers/kos-c++) +set(CMAKE_OBJC_COMPILER ${KOS_BASE}/utils/gnu_wrappers/kos-cc) +set(CMAKE_OBJCXX_COMPILER ${KOS_BASE}/utils/gnu_wrappers/kos-c++) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") @@ -78,18 +65,6 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_SYSROOT ${KOS_PORTS}) set(ENV{PKG_CONFIG_SYSROOT_DIR} ${KOS_PORTS}) -##### Add Platform-Specific #defines ##### -add_compile_definitions(__DREAMCAST__ _arch_dreamcast) - -if(${KOS_SUBARCH} MATCHES naomi) - add_compile_definitions(__NAOMI__ _arch_sub_naomi) -else() - add_compile_definitions(_arch_sub_pristine) -endif() - -##### Configure Build Flags ##### -add_compile_options(-ml -m4-single-only -ffunction-sections -fdata-sections -matomic-model=soft-imask -ftls-model=local-exec) - set(ENABLE_DEBUG_FLAGS $<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>) set(ENABLE_RELEASE_FLAGS $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>) @@ -101,41 +76,4 @@ add_compile_options( set(CMAKE_ASM_FLAGS "") set(CMAKE_ASM_FLAGS_RELEASE "") -##### Configure Include Directories ##### -set(CMAKE_SYSTEM_INCLUDE_PATH "${CMAKE_SYSTEM_INCLUDE_PATH} ${KOS_BASE}/include ${KOS_BASE}/kernel/arch/dreamcast/include ${KOS_BASE}/addons/include ${KOS_PORTS}/include") - -include_directories( - $ENV{KOS_BASE}/include - $ENV{KOS_BASE}/kernel/arch/dreamcast/include - $ENV{KOS_BASE}/addons/include - $ENV{KOS_PORTS}/include -) - -##### Configure Linker ##### -set(CMAKE_SYSTEM_LIBRARY_PATH "${CMAKE_SYSTEM_LIBRARY_PATH} ${KOS_BASE}/lib/dreamcast ${KOS_BASE}/addons/lib/dreamcast ${KOS_PORTS}/lib") - -if(${KOS_SUBARCH} MATCHES naomi) - add_link_options(-Wl,-Ttext=0x8c020000 -T${KOS_BASE}/utils/ldscripts/shlelf-naomi.xc) -else() - add_link_options(-Wl,-Ttext=0x8c010000 -T${KOS_BASE}/utils/ldscripts/shlelf.xc) -endif() - -add_link_options(-ml -m4-single-only -Wl,--gc-sections -nodefaultlibs) - -link_directories( - ${KOS_BASE}/lib/dreamcast - ${KOS_BASE}/addons/lib/dreamcast - ${KOS_PORTS}/lib -) - -add_link_options(-L${KOS_BASE}/lib/dreamcast -L${KOS_BASE}/addons/lib/dreamcast -L${KOS_PORTS}/lib) - -##### Custom Build Rules ##### -set(CMAKE_C_LINK_EXECUTABLE - "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> \ - -lm -Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group") -set(CMAKE_CXX_LINK_EXECUTABLE - "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> \ - -lm -Wl,--start-group -lstdc++ -lkallisti -lc -lgcc -Wl,--end-group") - include("${KOS_BASE}/utils/cmake/dreamcast.cmake") hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-04-21 17:50:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 5ae615b8c20b78cab7485856a6d8f541c331c089 (commit) from 2b9d90b825ad834bf53f39fd58651174076fe922 (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 5ae615b8c20b78cab7485856a6d8f541c331c089 Author: Paul Cercueil <pa...@cr...> Date: Sun Apr 21 19:50:00 2024 +0200 fs: Remove duplicated fcntl() function (#511) Newlib already provides fcntl(), which will end up calling _fcntl_r() provided by KOS. This previously did not cause problems as the linker would pick the first symbol found (which means the link order mattered). Rust however will complain that the symbol is duplicated. Address this by removing the KOS' fcntl(), which should not have any side effects. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/fs/fs.c | 2 +- kernel/libc/newlib/newlib_fcntl.c | 16 ++-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/kernel/fs/fs.c b/kernel/fs/fs.c index e027af1b..1f0e310b 100644 --- a/kernel/fs/fs.c +++ b/kernel/fs/fs.c @@ -696,7 +696,7 @@ int fs_rmdir(const char * fn) { } } -int fs_vfcntl(file_t fd, int cmd, va_list ap) { +static int fs_vfcntl(file_t fd, int cmd, va_list ap) { fs_hnd_t *h = fs_map_hnd(fd); int rv; diff --git a/kernel/libc/newlib/newlib_fcntl.c b/kernel/libc/newlib/newlib_fcntl.c index 1379020a..eab54cba 100644 --- a/kernel/libc/newlib/newlib_fcntl.c +++ b/kernel/libc/newlib/newlib_fcntl.c @@ -5,25 +5,13 @@ */ -#include <sys/reent.h> #include <sys/fcntl.h> -#include <stdarg.h> #include <kos/fs.h> +struct _reent; + int _fcntl_r(struct _reent *reent, int fd, int cmd, int arg) { (void)reent; return fs_fcntl(fd, cmd, arg); } - -extern int fs_vfcntl(file_t fd, int cmd, va_list ap); - -int fcntl(int fd, int cmd, ...) { - va_list ap; - int rv; - - va_start(ap, cmd); - rv = fs_vfcntl(fd, cmd, ap); - va_end(ap); - return rv; -} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-04-21 17:39:22
|
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 2b9d90b825ad834bf53f39fd58651174076fe922 (commit) via 85a4dd006497f23e3a308f291e84c25e8405ab7c (commit) from b7b8522fe822ee527715109ddd55470d727ddfb9 (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 2b9d90b825ad834bf53f39fd58651174076fe922 Merge: b7b8522f 85a4dd00 Author: darcagn <da...@pr...> Date: Sun Apr 21 12:38:54 2024 -0500 Merge pull request #522 from KallistiOS/authors_date_updates Updated the AUTHORS file to Add 2024 Dates commit 85a4dd006497f23e3a308f291e84c25e8405ab7c Author: Falco Girgis <gyr...@gm...> Date: Sun Apr 21 12:01:18 2024 -0500 Updated the AUTHORS file to add 2024 dates Added year 2024 for the following people: 1) Donald Haase 2) Paul Cercueil 3) Ruslan Rostovtsev ----------------------------------------------------------------------- Summary of changes: AUTHORS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index 65244f5b..1fcace82 100644 --- a/AUTHORS +++ b/AUTHORS @@ -27,7 +27,7 @@ Sam Steele: 2004 Gil Megidish: 2002 Florian Schulze: 2002 Walter van Niftrik: 2005 -Donald Haase: 2008, 2014, 2023 +Donald Haase: 2008, 2014, 2023, 2024 Andrew Kieschnick: 2000, 2001, 2002, 2003 Jordan DeLong: 2000, 2001, 2002 Bero: 2002 @@ -44,10 +44,10 @@ Stefan Galowicz: 2016, 2017 Luke Benstead: 2020, 2021, 2022, 2023 Eric Fradella: 2023, 2024 Falco Girgis: 2023, 2024 -Ruslan Rostovtsev: 2014, 2016, 2023 +Ruslan Rostovtsev: 2014, 2016, 2023, 2024 Colton Pawielski: 2023 Andy Barajas: 2023, 2024 -Paul Cercueil: 2023 +Paul Cercueil: 2023, 2024 Files with Specific licenses: ----------------------------- hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-04-21 17:14:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via b7b8522fe822ee527715109ddd55470d727ddfb9 (commit) from dc96eb1d8de0dc77818ab6817ea473e3433239c4 (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 b7b8522fe822ee527715109ddd55470d727ddfb9 Author: Paul Cercueil <pa...@cr...> Date: Sun Apr 21 19:14:02 2024 +0200 init: Add init flags to enable/disable DCLOAD, CDROM (#516) * init: Add INIT_CDROM flag to init flags This flag, enabled by default, tells KallistiOS to initialize the CD-ROM subsystem as well as the ISO-9660 filesystem code. Some init functions had their prototype modified to be used with the init-flags mechanism. Signed-off-by: Paul Cercueil <pa...@cr...> * init: Garbage-collect dcload code when INIT_NO_DCLOAD flag is set When the INIT_NO_DCLOAD flag is set to the init flags, all the code that handles init, processing and shutdown of dcload can be garbage-collected. Signed-off-by: Paul Cercueil <pa...@cr...> --------- Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/fs/fs_dcload.c | 14 +++---- kernel/arch/dreamcast/fs/fs_dclsocket.c | 6 +-- kernel/arch/dreamcast/fs/fs_iso9660.c | 8 ++-- kernel/arch/dreamcast/hardware/cdrom.c | 4 +- kernel/arch/dreamcast/hardware/hardware.c | 11 ++++-- kernel/arch/dreamcast/include/arch/init_flags.h | 13 ++++++- kernel/arch/dreamcast/include/dc/cdrom.h | 5 +-- kernel/arch/dreamcast/include/dc/fs_dcload.h | 4 +- kernel/arch/dreamcast/include/dc/fs_dclsocket.h | 2 +- kernel/arch/dreamcast/include/dc/fs_iso9660.h | 4 +- kernel/arch/dreamcast/kernel/init.c | 52 ++++++++++++++++++------- 11 files changed, 80 insertions(+), 43 deletions(-) diff --git a/kernel/arch/dreamcast/fs/fs_dcload.c b/kernel/arch/dreamcast/fs/fs_dcload.c index 38946ab5..f43b2082 100644 --- a/kernel/arch/dreamcast/fs/fs_dcload.c +++ b/kernel/arch/dreamcast/fs/fs_dcload.c @@ -529,15 +529,15 @@ void fs_dcload_init_console(void) { } /* Call fs_dcload_init_console() before calling fs_dcload_init() */ -int fs_dcload_init(void) { +void fs_dcload_init(void) { // This was already done in init_console. if(dcload_type == DCLOAD_TYPE_NONE) - return -1; + return; /* Check for combination of KOS networking and dcload-ip */ if((dcload_type == DCLOAD_TYPE_IP) && (__kos_init_flags & INIT_NET)) { dbglog(DBG_INFO, "dc-load console+kosnet, will switch to internal ethernet\n"); - return -1; + return; /* if(old_printk) { dbgio_set_printk(old_printk); old_printk = 0; @@ -546,13 +546,13 @@ int fs_dcload_init(void) { } /* Register with VFS */ - return nmmgr_handler_add(&vh.nmmgr); + nmmgr_handler_add(&vh.nmmgr); } -int fs_dcload_shutdown(void) { +void fs_dcload_shutdown(void) { /* Check for dcload */ if(*DCLOADMAGICADDR != DCLOADMAGICVALUE) - return -1; + return; /* Free dcload wrkram */ if(dcload_wrkmem) { @@ -566,7 +566,7 @@ int fs_dcload_shutdown(void) { dbgio_dev_select("scif"); } - return nmmgr_handler_remove(&vh.nmmgr); + nmmgr_handler_remove(&vh.nmmgr); } /* used for dcload-ip + lwIP diff --git a/kernel/arch/dreamcast/fs/fs_dclsocket.c b/kernel/arch/dreamcast/fs/fs_dclsocket.c index 943a56d0..a965d39c 100644 --- a/kernel/arch/dreamcast/fs/fs_dclsocket.c +++ b/kernel/arch/dreamcast/fs/fs_dclsocket.c @@ -837,12 +837,12 @@ error: return -1; } -int fs_dclsocket_shutdown(void) { +void fs_dclsocket_shutdown(void) { int old; command_t cmd; if(initted != 2) - return -1; + return; dbglog(DBG_INFO, "fs_dclsocket: About to disable console\n"); @@ -869,5 +869,5 @@ int fs_dclsocket_shutdown(void) { /* Finally, clean up the socket */ close(dcls_socket); - return nmmgr_handler_remove(&vh.nmmgr); + nmmgr_handler_remove(&vh.nmmgr); } diff --git a/kernel/arch/dreamcast/fs/fs_iso9660.c b/kernel/arch/dreamcast/fs/fs_iso9660.c index 20d6f766..ce8e2cb8 100644 --- a/kernel/arch/dreamcast/fs/fs_iso9660.c +++ b/kernel/arch/dreamcast/fs/fs_iso9660.c @@ -1053,7 +1053,7 @@ static vfs_handler_t vh = { }; /* Initialize the file system */ -int fs_iso9660_init(void) { +void fs_iso9660_init(void) { int i; /* Reset fd's */ @@ -1081,11 +1081,11 @@ int fs_iso9660_init(void) { iso_vblank_hnd = vblank_handler_add(iso_vblank, NULL); /* Register with VFS */ - return nmmgr_handler_add(&vh.nmmgr); + nmmgr_handler_add(&vh.nmmgr); } /* De-init the file system */ -int fs_iso9660_shutdown(void) { +void fs_iso9660_shutdown(void) { int i; /* De-register with vblank */ @@ -1101,5 +1101,5 @@ int fs_iso9660_shutdown(void) { mutex_destroy(&cache_mutex); mutex_destroy(&fh_mutex); - return nmmgr_handler_remove(&vh.nmmgr); + nmmgr_handler_remove(&vh.nmmgr); } diff --git a/kernel/arch/dreamcast/hardware/cdrom.c b/kernel/arch/dreamcast/hardware/cdrom.c index d645dc68..abb4b028 100644 --- a/kernel/arch/dreamcast/hardware/cdrom.c +++ b/kernel/arch/dreamcast/hardware/cdrom.c @@ -470,7 +470,7 @@ int cdrom_spin_down(void) { } /* Initialize: assume no threading issues */ -int cdrom_init(void) { +void cdrom_init(void) { uint32_t p; volatile uint32_t *react = (uint32_t *)(0x005f74e4 | MEM_AREA_P2_BASE); volatile uint32_t *bios = (uint32_t *)MEM_AREA_P2_BASE; @@ -500,7 +500,7 @@ int cdrom_init(void) { gdc_init_system(); mutex_unlock(&_g1_ata_mutex); - return cdrom_reinit(); + cdrom_reinit(); } void cdrom_shutdown(void) { diff --git a/kernel/arch/dreamcast/hardware/hardware.c b/kernel/arch/dreamcast/hardware/hardware.c index c37066cc..a91a0ba6 100644 --- a/kernel/arch/dreamcast/hardware/hardware.c +++ b/kernel/arch/dreamcast/hardware/hardware.c @@ -58,6 +58,11 @@ KOS_INIT_FLAG_WEAK(bba_la_init, false); KOS_INIT_FLAG_WEAK(bba_la_shutdown, false); KOS_INIT_FLAG_WEAK(maple_init, true); +#ifndef _arch_sub_naomi +KOS_INIT_FLAG_WEAK(cdrom_init, true); +KOS_INIT_FLAG_WEAK(cdrom_shutdown, true); +#endif + int hardware_periph_init(void) { /* Init sound */ spu_init(); @@ -65,7 +70,7 @@ int hardware_periph_init(void) { #ifndef _arch_sub_naomi /* Init CD-ROM.. NOTE: NO GD-ROM SUPPORT. ONLY CDs/CDRs. */ - cdrom_init(); + KOS_INIT_FLAG_CALL(cdrom_init); #endif /* Setup maple bus */ @@ -92,9 +97,7 @@ void hardware_shutdown(void) { KOS_INIT_FLAG_CALL(bba_la_shutdown); #endif KOS_INIT_FLAG_CALL(maple_shutdown); -#if 0 - cdrom_shutdown(); -#endif + KOS_INIT_FLAG_CALL(cdrom_shutdown); g2_dma_shutdown(); spu_shutdown(); vid_shutdown(); diff --git a/kernel/arch/dreamcast/include/arch/init_flags.h b/kernel/arch/dreamcast/include/arch/init_flags.h index f22c3bed..3a1d053c 100644 --- a/kernel/arch/dreamcast/include/arch/init_flags.h +++ b/kernel/arch/dreamcast/include/arch/init_flags.h @@ -44,6 +44,15 @@ __BEGIN_DECLS \sa KOS_INIT_FLAGS() */ #define KOS_INIT_FLAGS_ARCH(flags) \ + KOS_INIT_FLAG_NONE(flags, INIT_NO_DCLOAD, dcload_init); \ + KOS_INIT_FLAG_NONE(flags, INIT_NO_DCLOAD, fs_dcload_init_console); \ + KOS_INIT_FLAG_NONE(flags, INIT_NO_DCLOAD, fs_dcload_shutdown); \ + KOS_INIT_FLAG_NONE(flags, INIT_NO_DCLOAD, arch_init_net_dcload_ip); \ + KOS_INIT_FLAG(flags, INIT_NO_DCLOAD, arch_init_net_no_dcload); \ + KOS_INIT_FLAG(flags, INIT_CDROM, cdrom_init); \ + KOS_INIT_FLAG(flags, INIT_CDROM, cdrom_shutdown); \ + KOS_INIT_FLAG(flags, INIT_CDROM, fs_iso9660_init); \ + KOS_INIT_FLAG(flags, INIT_CDROM, fs_iso9660_shutdown); \ KOS_INIT_FLAG(flags, INIT_CONTROLLER, cont_init); \ KOS_INIT_FLAG(flags, INIT_CONTROLLER, cont_shutdown); \ KOS_INIT_FLAG(flags, INIT_KEYBOARD, kbd_init); \ @@ -79,7 +88,7 @@ __BEGIN_DECLS */ /** \brief Default init flags for the Dreamcast. */ -#define INIT_DEFAULT_ARCH (INIT_MAPLE_ALL) +#define INIT_DEFAULT_ARCH (INIT_MAPLE_ALL | INIT_CDROM) #define INIT_CONTROLLER 0x00001000 /**< \brief Enable Controller maple driver */ #define INIT_KEYBOARD 0x00002000 /**< \brief Enable Keyboard maple driver */ @@ -91,6 +100,8 @@ __BEGIN_DECLS #define INIT_DREAMEYE 0x00080000 /**< \brief Enable DreamEye maple driver */ #define INIT_MAPLE_ALL 0x000ff000 /**< \brief Enable all Maple drivers */ +#define INIT_CDROM 0x00100000 /**< \brief Enable CD-ROM support */ + #define INIT_OCRAM 0x10000000 /**< \brief Use half of the dcache as RAM */ #define INIT_NO_DCLOAD 0x20000000 /**< \brief Disable dcload */ diff --git a/kernel/arch/dreamcast/include/dc/cdrom.h b/kernel/arch/dreamcast/include/dc/cdrom.h index d8480b86..32d216d4 100644 --- a/kernel/arch/dreamcast/include/dc/cdrom.h +++ b/kernel/arch/dreamcast/include/dc/cdrom.h @@ -493,11 +493,8 @@ int cdrom_spin_down(void); This initializes the CD-ROM reading system, reactivating the drive and handling initial setup of the disc. - - \retval 0 On success. - \retval -1 Already initted, shutdown before initting again. */ -int cdrom_init(void); +void cdrom_init(void); /** \brief Shutdown the CD reading system. \ingroup gdrom diff --git a/kernel/arch/dreamcast/include/dc/fs_dcload.h b/kernel/arch/dreamcast/include/dc/fs_dcload.h index 0f0c27e2..5810e043 100644 --- a/kernel/arch/dreamcast/include/dc/fs_dcload.h +++ b/kernel/arch/dreamcast/include/dc/fs_dcload.h @@ -140,8 +140,8 @@ int dcload_unlink(vfs_handler_t * vfs, const char *fn); /* Init func */ void fs_dcload_init_console(void); -int fs_dcload_init(void); -int fs_dcload_shutdown(void); +void fs_dcload_init(void); +void fs_dcload_shutdown(void); /* Init func for dcload-ip + lwIP */ int fs_dcload_init_lwip(void *p); diff --git a/kernel/arch/dreamcast/include/dc/fs_dclsocket.h b/kernel/arch/dreamcast/include/dc/fs_dclsocket.h index adb6dc8b..310837b9 100644 --- a/kernel/arch/dreamcast/include/dc/fs_dclsocket.h +++ b/kernel/arch/dreamcast/include/dc/fs_dclsocket.h @@ -36,7 +36,7 @@ extern dbgio_handler_t dbgio_dcls; void fs_dclsocket_init_console(void); int fs_dclsocket_init(void); -int fs_dclsocket_shutdown(void); +void fs_dclsocket_shutdown(void); /* \endcond */ /** @} */ diff --git a/kernel/arch/dreamcast/include/dc/fs_iso9660.h b/kernel/arch/dreamcast/include/dc/fs_iso9660.h index 489b08bf..e2f245b7 100644 --- a/kernel/arch/dreamcast/include/dc/fs_iso9660.h +++ b/kernel/arch/dreamcast/include/dc/fs_iso9660.h @@ -48,8 +48,8 @@ __BEGIN_DECLS int iso_reset(void); /* \cond */ -int fs_iso9660_init(void); -int fs_iso9660_shutdown(void); +void fs_iso9660_init(void); +void fs_iso9660_shutdown(void); /* \endcond */ /** @} */ diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index ee6ecf89..eaff1d5f 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -58,13 +58,13 @@ dbgio_handler_t * dbgio_handlers[] = { }; int dbgio_handler_cnt = sizeof(dbgio_handlers) / sizeof(dbgio_handler_t *); -void arch_init_net(void) { +void arch_init_net_dcload_ip(void) { union { uint32 ipl; uint8 ipb[4]; } ip = { 0 }; - if(!(__kos_init_flags & INIT_NO_DCLOAD) && dcload_type == DCLOAD_TYPE_IP) { + if(dcload_type == DCLOAD_TYPE_IP) { /* Grab the IP address from dcload before we disable dbgio... */ ip.ipl = _fs_dclsocket_get_ip(); dbglog(DBG_INFO, "dc-load says our IP is %d.%d.%d.%d\n", ip.ipb[3], @@ -74,7 +74,7 @@ void arch_init_net(void) { net_init(ip.ipl); /* Enable networking (and drivers) */ - if(!(__kos_init_flags & INIT_NO_DCLOAD) && dcload_type == DCLOAD_TYPE_IP) { + if(dcload_type == DCLOAD_TYPE_IP) { fs_dclsocket_init_console(); if(!fs_dclsocket_init()) { @@ -85,6 +85,18 @@ void arch_init_net(void) { } } +void arch_init_net_no_dcload(void) { + net_init(0); +} + +KOS_INIT_FLAG_WEAK(arch_init_net_dcload_ip, true); +KOS_INIT_FLAG_WEAK(arch_init_net_no_dcload, false); + +void arch_init_net(void) { + KOS_INIT_FLAG_CALL(arch_init_net_dcload_ip); + KOS_INIT_FLAG_CALL(arch_init_net_no_dcload); +} + void vmu_fs_init(void) { fs_vmu_init(); vmufs_init(); @@ -114,6 +126,23 @@ KOS_INIT_FLAG_WEAK(fs_romdisk_mount_builtin_legacy, false); KOS_INIT_FLAG_WEAK(vmu_fs_init, true); KOS_INIT_FLAG_WEAK(vmu_fs_shutdown, true); +#ifndef _arch_sub_naomi +KOS_INIT_FLAG_WEAK(fs_iso9660_init, true); +KOS_INIT_FLAG_WEAK(fs_iso9660_shutdown, true); +#endif + +void dcload_init(void) { + if (*DCLOADMAGICADDR == DCLOADMAGICVALUE) { + dbglog(DBG_INFO, "dc-load console support enabled\n"); + fs_dcload_init(); + } +} + +KOS_INIT_FLAG_WEAK(dcload_init, true); +KOS_INIT_FLAG_WEAK(fs_dcload_init_console, true); +KOS_INIT_FLAG_WEAK(fs_dcload_shutdown, true); +KOS_INIT_FLAG_WEAK(fs_dclsocket_shutdown, true); + /* Auto-init stuff: override with a non-weak symbol if you don't want all of this to be linked into your code (and do the same with the arch_auto_shutdown function too). */ @@ -128,8 +157,8 @@ int __weak arch_auto_init(void) { ubc_init(); - if(!(__kos_init_flags & INIT_NO_DCLOAD)) - fs_dcload_init_console(); /* Init dc-load console, if applicable */ + /* Init dc-load console, if applicable */ + KOS_INIT_FLAG_CALL(fs_dcload_init_console); /* Init SCIF for debug stuff (maybe) */ scif_init(); @@ -176,13 +205,10 @@ int __weak arch_auto_init(void) { if(!KOS_INIT_FLAG_CALL(fs_romdisk_mount_builtin)) KOS_INIT_FLAG_CALL(fs_romdisk_mount_builtin_legacy); - if(!(__kos_init_flags & INIT_NO_DCLOAD) && *DCLOADMAGICADDR == DCLOADMAGICVALUE) { - dbglog(DBG_INFO, "dc-load console support enabled\n"); - fs_dcload_init(); - } + KOS_INIT_FLAG_CALL(dcload_init); #ifndef _arch_sub_naomi - fs_iso9660_init(); + KOS_INIT_FLAG_CALL(fs_iso9660_init); #endif KOS_INIT_FLAG_CALL(vmu_fs_init); @@ -204,7 +230,7 @@ int __weak arch_auto_init(void) { } void __weak arch_auto_shutdown(void) { - fs_dclsocket_shutdown(); + KOS_INIT_FLAG_CALL(fs_dclsocket_shutdown); #ifndef _arch_sub_naomi KOS_INIT_FLAG_CALL(net_shutdown); #endif @@ -215,10 +241,10 @@ void __weak arch_auto_shutdown(void) { hardware_shutdown(); pvr_shutdown(); library_shutdown(); - fs_dcload_shutdown(); + KOS_INIT_FLAG_CALL(fs_dcload_shutdown); KOS_INIT_FLAG_CALL(vmu_fs_shutdown); #ifndef _arch_sub_naomi - fs_iso9660_shutdown(); + KOS_INIT_FLAG_CALL(fs_iso9660_shutdown); #endif #if defined(__NEWLIB__) && !(__NEWLIB__ < 2 && __NEWLIB_MINOR__ < 4) fs_dev_shutdown(); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-04-21 11:55:48
|
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 dc96eb1d8de0dc77818ab6817ea473e3433239c4 (commit) via b9bec623cde2670b8c376175fbf1833d0794dd5d (commit) from f7a14e260dc6dfa55eec1f417b2c661101732773 (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 dc96eb1d8de0dc77818ab6817ea473e3433239c4 Merge: f7a14e26 b9bec623 Author: darcagn <da...@pr...> Date: Sun Apr 21 06:55:20 2024 -0500 Merge pull request #521 from KallistiOS/banner_copyright_update Updated Copyright Date for KOS's License commit b9bec623cde2670b8c376175fbf1833d0794dd5d Author: Falco Girgis <gyr...@gm...> Date: Sun Apr 21 06:06:45 2024 -0500 Updated copyright date for KOS's license. - located in banner.c: kos_get_license(). ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/banner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/arch/dreamcast/kernel/banner.c b/kernel/arch/dreamcast/kernel/banner.c index 3567c470..91bfbe6a 100644 --- a/kernel/arch/dreamcast/kernel/banner.c +++ b/kernel/arch/dreamcast/kernel/banner.c @@ -8,7 +8,7 @@ #include "authors.h" static const char license[] = -"Copyright (C) 1997-2023 KallistiOS Contributors. All rights reserved.\n" +"Copyright (C) 1997-2024 KallistiOS Contributors. All rights reserved.\n" "\n" "Redistribution and use in source and binary forms, with or without\n" "modification, are permitted provided that the following conditions\n" hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-04-21 08:04: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 f7a14e260dc6dfa55eec1f417b2c661101732773 (commit) via 5145efaaf5f6b816a0bb2bb69a81405b4ecdc5d2 (commit) from c1410a93e38ab6f80efcb9400b47c8451d490d13 (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 f7a14e260dc6dfa55eec1f417b2c661101732773 Author: Paul Cercueil <pa...@cr...> Date: Sun Apr 21 10:03:27 2024 +0200 maple: Fix race between IRQ and threads (#517) The IRQ handler and threads would read-modify-write the state->queue_len field as if races didn't exist. Address this issue by using atomics instead. Note that the code in the IRQ handler is using atomic routines as well just to be future-proof, as it may very well be called from a threaded interrupt handler in the future. This has the added benefit that it also tells GCC that the 'queue_len' may be updated outside the visible scope, and therefore its value may change at any moment. This fixes the code not working properly when building with LTO. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: .gitignore | 2 ++ kernel/arch/dreamcast/hardware/maple/keyboard.c | 8 ++++---- kernel/arch/dreamcast/include/dc/maple/keyboard.h | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index bfc7f1f1..9d351605 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,8 @@ examples/dreamcast/kgl/basic/vq/fruit.vq examples/dreamcast/conio/adventure/data.c examples/dreamcast/conio/adventure/datagen examples/dreamcast/png/romdisk_boot.img +examples/dreamcast/pvr/bumpmap/romdisk/bricks.kmg +examples/dreamcast/pvr/bumpmap/romdisk/bumpmap.raw examples/dreamcast/pvr/modifier_volume_tex/romdisk/fruit.kmg examples/dreamcast/pvr/texture_render/texture_render.bin utils/dc-chain/logs diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index cc5dbe4f..9137ecc8 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -410,10 +410,10 @@ static int kbd_enqueue(kbd_state_t *state, uint8 keycode, int mods) { return 0; /* Queue the key up on the device-specific queue. */ - if(state->queue_len < KBD_QUEUE_SIZE) { + if(atomic_load(&state->queue_len) < KBD_QUEUE_SIZE) { state->key_queue[state->queue_head] = keycode | (mods << 8); state->queue_head = (state->queue_head + 1) & (KBD_QUEUE_SIZE - 1); - ++state->queue_len; + atomic_fetch_add(&state->queue_len, 1); } /* If queueing is turned off, don't bother with the global queue. */ @@ -463,12 +463,12 @@ int kbd_queue_pop(maple_device_t *dev, int xlat) { uint32 rv, mods; uint8 ascii; - if(!state->queue_len) + if(!atomic_load(&state->queue_len)) return -1; rv = state->key_queue[state->queue_tail]; state->queue_tail = (state->queue_tail + 1) & (KBD_QUEUE_SIZE - 1); - --state->queue_len; + atomic_fetch_sub(&state->queue_len, 1); if(!xlat) return (int)rv; diff --git a/kernel/arch/dreamcast/include/dc/maple/keyboard.h b/kernel/arch/dreamcast/include/dc/maple/keyboard.h index 51be9173..56d1567e 100644 --- a/kernel/arch/dreamcast/include/dc/maple/keyboard.h +++ b/kernel/arch/dreamcast/include/dc/maple/keyboard.h @@ -28,6 +28,8 @@ __BEGIN_DECLS #include <arch/types.h> #include <dc/maple.h> +#include <stdatomic.h> + /** \defgroup kbd Keyboard \brief Driver for the Dreamcast's Keyboard Input Device \ingroup peripherals @@ -297,7 +299,7 @@ typedef struct kbd_state { uint32 key_queue[KBD_QUEUE_SIZE]; int queue_tail; /**< \brief Key queue tail. */ int queue_head; /**< \brief Key queue head. */ - int queue_len; /**< \brief Current length of queue. */ + atomic_int queue_len; /**< \brief Current length of queue. */ uint8 kbd_repeat_key; /**< \brief Key that is repeating. */ uint64 kbd_repeat_timer; /**< \brief Time that the next repeat will trigger. */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-04-21 08:03:47
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, warnings_fixes has been created at 620b446751285932f4213266599f55f1de79a90a (commit) - Log ----------------------------------------------------------------- commit 620b446751285932f4213266599f55f1de79a90a Author: Falco Girgis <gyr...@gm...> Date: Sun Apr 21 01:24:08 2024 -0500 Fixed all Doxygen warnings. commit 316c185a868bac317d8127248db20bc7908f74ed Author: Falco Girgis <gyr...@gm...> Date: Sun Apr 21 00:29:56 2024 -0500 Fixed (lying) overflow warning from readdir(). - We were writing to an array of size 0... which was ALWAYS followed by a sized array of the correct size... GCC didn't care. - Swapped readdir() to use the backing array directly, rather than the size 0 array. commit 4e17691a9baa48081ec650eecfe49ff57050e081 Author: Falco Girgis <gyr...@gm...> Date: Sun Apr 21 00:22:07 2024 -0500 Fixed release build warnings from defining NDEBUG. - All of them were for unused variables. They were being used within assert() statements that have now been compiled out. - Added (void) expressions around the variables to get GCC to shut up. commit 5145efaaf5f6b816a0bb2bb69a81405b4ecdc5d2 Author: Tchan0 <617...@us...> Date: Sun Apr 21 00:56:11 2024 +0200 add missing examples temp files to gitignore (#515) Co-authored-by: T_chan <> ----------------------------------------------------------------------- hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2024-04-20 04:26:29
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The KallistiOS port of OpenGL.". The branch, master has been updated via 8a4be75e53e7520ff558df1e2b2736db0f4abbb4 (commit) from 4c8c082e0675162a1482a810210dec6d4202dc3e (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 8a4be75e53e7520ff558df1e2b2736db0f4abbb4 Author: Falco Girgis <gyr...@gm...> Date: Fri Apr 19 23:23:17 2024 -0500 Fixed KGL SQ Usage (#2) * Fix for broken SQ usage by KGL * Fixes for -m4-single 1) double-precision floating point constants -> single-precision 2) used KOS's macros for FP argument order to inline ASM ----------------------------------------------------------------------- Summary of changes: gl-pvr.c | 49 ++----------------------------------------------- gl-pvr.h | 3 --- gl-sh4.h | 20 ++++++++++++-------- 3 files changed, 14 insertions(+), 58 deletions(-) diff --git a/gl-pvr.c b/gl-pvr.c index 1d13460..af6fe65 100644 --- a/gl-pvr.c +++ b/gl-pvr.c @@ -53,53 +53,8 @@ static GLuint GL_VERTS[2] = {0, 0}, static GL_MULTITEX_OBJECT GL_MTOBJS[GL_KOS_MAX_MULTITEXTURE_OBJECTS]; static GLuint GL_MTOBJECTS = 0; -#if 0 -/* Custom version of sq_cpy from KOS for copying vertex data to the PVR */ -static inline void pvr_list_submit(void *src, int n) { - GLuint *d = TA_SQ_ADDR; - GLuint *s = src; - - /* fill/write queues as many times necessary */ - while(n--) { - asm("pref @%0" : : "r"(s + 8)); /* prefetch 32 bytes for next loop */ - d[0] = *(s++); - d[1] = *(s++); - d[2] = *(s++); - d[3] = *(s++); - d[4] = *(s++); - d[5] = *(s++); - d[6] = *(s++); - d[7] = *(s++); - asm("pref @%0" : : "r"(d)); - d += 8; - } - - /* Wait for both store queues to complete */ - d = (GLuint *)0xe0000000; - d[0] = d[8] = 0; -} - -/* Custom version of sq_cpy from KOS for copying 32bytes of vertex data to the PVR */ -static inline void pvr_hdr_submit(const GLuint *src) { - GLuint *d = TA_SQ_ADDR; - - d[0] = *(src++); - d[1] = *(src++); - d[2] = *(src++); - d[3] = *(src++); - d[4] = *(src++); - d[5] = *(src++); - d[6] = *(src++); - d[7] = *(src++); - - asm("pref @%0" : : "r"(d)); -} -#else - -#define pvr_list_submit(src, n) sq_cpy(TA_SQ_ADDR, (src), ((n) << 5)) -#define pvr_hdr_submit(src) sq_cpy(TA_SQ_ADDR, (src), 32) - -#endif +#define pvr_list_submit(src, n) pvr_sq_load(NULL, (src), ((n) << 5), PVR_DMA_TA) +#define pvr_hdr_submit(src) pvr_sq_load(NULL, (src), 32, PVR_DMA_TA) inline void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex, pvr_vertex_t *src, diff --git a/gl-pvr.h b/gl-pvr.h index 5348d04..12f952a 100644 --- a/gl-pvr.h +++ b/gl-pvr.h @@ -34,9 +34,6 @@ typedef struct { //#define GL_USE_FLOAT 0 /* Use PVR's floating-point color Vertex Type (64bit) *NoOp* */ /* Misc SH4->PVR Commands */ -#define TA_SQ_ADDR (unsigned int *)(void *) \ - (0xe0000000 | (((unsigned long)0x10000000) & 0x03ffffe0)) - #define QACRTA ((((unsigned int)0x10000000)>>26)<<2)&0x1c #define PVR_TA_TXR_FILTER_SHIFT 14 diff --git a/gl-sh4.h b/gl-sh4.h index 488effd..a669995 100644 --- a/gl-sh4.h +++ b/gl-sh4.h @@ -9,14 +9,18 @@ #ifndef GL_SH4_H #define GL_SH4_H +#include <arch/args.h> + +#define GL_KOS_USE_DMA 1 + typedef float vector3f[3]; /* 3 float vector */ typedef float matrix4f[4][4]; /* 4x4 float matrix */ /* DEG2RAD - convert Degrees to Radians = PI / 180.0f */ -#define DEG2RAD (0.01745329251994329576923690768489) +#define DEG2RAD (0.01745329251994329576923690768489f) /* Calculate Spot Light Angle Cosine = (PI / 180.0f) * (n / 2) */ -#define LCOS(n) fcos(n*0.00872664625997164788461845384244) +#define LCOS(n) fcos(n*0.00872664625997164788461845384244f) /* Internal GL API macro */ #define mat_trans_fv12() { \ @@ -50,10 +54,10 @@ typedef float matrix4f[4][4]; /* 4x4 float matrix */ } #define mat_trans_texture4(s, t, r, q) { \ - register float __s __asm__("fr4") = (s); \ - register float __t __asm__("fr5") = (t); \ - register float __r __asm__("fr6") = (r); \ - register float __q __asm__("fr7") = (q); \ + register float __s __asm__(KOS_FPARG(0)) = (s); \ + register float __t __asm__(KOS_FPARG(1)) = (t); \ + register float __r __asm__(KOS_FPARG(2)) = (r); \ + register float __q __asm__(KOS_FPARG(3)) = (q); \ __asm__ __volatile__( \ "ftrv xmtrx,fv4\n" \ "fldi1 fr6\n" \ @@ -67,8 +71,8 @@ typedef float matrix4f[4][4]; /* 4x4 float matrix */ } #define mat_trans_texture2_nomod(s, t, so, to) { \ - register float __s __asm__("fr4") = (s); \ - register float __t __asm__("fr5") = (t); \ + register float __s __asm__(KOS_FPARG(0)) = (s); \ + register float __t __asm__(KOS_FPARG(1)) = (t); \ __asm__ __volatile__( \ "fldi0 fr6\n" \ "fldi1 fr7\n" \ hooks/post-receive -- The KallistiOS port of OpenGL. |
From: falcovorbis <fal...@us...> - 2024-04-20 03:11: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 c1410a93e38ab6f80efcb9400b47c8451d490d13 (commit) from ab6634d7e39a0e1ff371e6bf7288c2fc88fc4b29 (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 c1410a93e38ab6f80efcb9400b47c8451d490d13 Author: Paul Cercueil <pa...@cr...> Date: Sat Apr 20 05:11:45 2024 +0200 init: Add KOS_NO_SHUTDOWN flag to disable shutdown (#509) Serious homebrew games and apps generally don't have any way to return to the calling application; exiting them means rebooting the console. Those applications can now shave off a few kilobytes of RAM by using the KOS_NO_SHUTDOWN init flag. Signed-off-by: Paul Cercueil <pa...@cr...> Co-authored-by: Falco Girgis <gyr...@gm...> ----------------------------------------------------------------------- Summary of changes: include/kos/init.h | 2 ++ kernel/libc/newlib/newlib_exit.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/kos/init.h b/include/kos/init.h index abb6ee9c..bb14f069 100644 --- a/include/kos/init.h +++ b/include/kos/init.h @@ -61,6 +61,7 @@ __BEGIN_DECLS KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_init); \ KOS_INIT_FLAG(flags, INIT_FS_ROMDISK, fs_romdisk_shutdown); \ KOS_INIT_FLAG(flags, INIT_EXPORT, export_init); \ + KOS_INIT_FLAG_NONE(flags, INIT_NO_SHUTDOWN, kos_shutdown); \ KOS_INIT_FLAGS_ARCH(flags) #define __KOS_INIT_FLAGS_1(flags) \ @@ -138,6 +139,7 @@ extern void * __kos_romdisk; #define INIT_QUIET 0x00000010 /**< \brief Disable dbgio */ #define INIT_EXPORT 0x00000020 /**< \brief Export kernel symbols */ #define INIT_FS_ROMDISK 0x00000040 /**< \brief Enable support for romdisks */ +#define INIT_NO_SHUTDOWN 0x00000080 /**< \brief Disable hardware shutdown */ /** @} */ __END_DECLS diff --git a/kernel/libc/newlib/newlib_exit.c b/kernel/libc/newlib/newlib_exit.c index ff1dfeee..3ab369ca 100644 --- a/kernel/libc/newlib/newlib_exit.c +++ b/kernel/libc/newlib/newlib_exit.c @@ -6,9 +6,23 @@ */ #include <arch/arch.h> +#include <stdbool.h> extern void arch_exit_handler(int ret_code) __noreturn; +static int ret_code; + +void kos_shutdown(void) +{ + arch_exit_handler(ret_code); + + __builtin_unreachable(); +} + +KOS_INIT_FLAG_WEAK(kos_shutdown, true); + void _exit(int code) { - arch_exit_handler(code); + ret_code = code; + + KOS_INIT_FLAG_CALL(kos_shutdown); } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-04-19 21:07: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 ab6634d7e39a0e1ff371e6bf7288c2fc88fc4b29 (commit) via 6818e1c9aee7346ee4d7dea24c9c767d727e3d39 (commit) via b8ca531ec6d9fd8c25747f92f0e873552ec65c33 (commit) via 148611ffffa434cd186d8d8535113b7cdd90918e (commit) from ede9ebfd0eb7ac0be7a787fed379a2e7baffcbf4 (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 ab6634d7e39a0e1ff371e6bf7288c2fc88fc4b29 Merge: 6818e1c9 148611ff Author: Luke Benstead <ka...@gm...> Date: Fri Apr 19 21:25:19 2024 +0100 Merge pull request #510 from KallistiOS/cmake_min Set minimum Cmake version based on actual minimum requirements commit 6818e1c9aee7346ee4d7dea24c9c767d727e3d39 Merge: ede9ebfd b8ca531e Author: Luke Benstead <ka...@gm...> Date: Fri Apr 19 21:22:02 2024 +0100 Merge pull request #512 from pcercuei/fix-gdb-stub gdb-stub: Fix GDB stub broken since IRQ context rework commit b8ca531ec6d9fd8c25747f92f0e873552ec65c33 Author: Paul Cercueil <pa...@cr...> Date: Thu Apr 18 23:05:24 2024 +0200 gdb-stub: Fix GDB stub broken since IRQ context rework The GDB stub was broken since commit a7789e643 ("Faster IRQ context saving / restore (#406)"). This was because the GDB stub did not bother to use the irq_context_t structure, and instead would just make assumptions on the layout of the structure. Signed-off-by: Paul Cercueil <pa...@cr...> commit 148611ffffa434cd186d8d8535113b7cdd90918e Author: QuzarDC <qu...@co...> Date: Mon Apr 15 10:36:52 2024 -0400 Set minimum version required based on actual minimum requirements ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/gdb_stub.c | 46 ++++++++++++++------------------- utils/cmake/dreamcast.cmake | 3 ++- utils/cmake/dreamcast.toolchain.cmake | 3 ++- 3 files changed, 23 insertions(+), 29 deletions(-) diff --git a/kernel/arch/dreamcast/kernel/gdb_stub.c b/kernel/arch/dreamcast/kernel/gdb_stub.c index af1f61d2..062c76a4 100644 --- a/kernel/arch/dreamcast/kernel/gdb_stub.c +++ b/kernel/arch/dreamcast/kernel/gdb_stub.c @@ -154,6 +154,7 @@ #include <arch/arch.h> #include <arch/cache.h> +#include <stddef.h> #include <string.h> /* Hitachi SH architecture instruction encoding masks */ @@ -235,18 +236,9 @@ static int dofault; /* Non zero, bus errors will raise exception */ /* debug > 0 prints ill-formed commands in valid packets & checksum errors */ static int remote_debug; -enum regnames { - R0, R1, R2, R3, R4, R5, R6, R7, - R8, R9, R10, R11, R12, R13, R14, R15, - PC, PR, GBR, VBR, MACH, MACL, SR, - FPUL, FPSCR, - FR0, FR1, FR2, FR3, FR4, FR5, FR6, FR7, - FR8, FR9, FR10, FR11, FR12, FR13, FR14, FR15 -}; - /* map from KOS register context order to GDB sh4 order */ -#define KOS_REG( r ) ( ((uint32)&((irq_context_t*)0)->r) / sizeof(uint32) ) +#define KOS_REG(r) offsetof(irq_context_t, r) static uint32 kosRegMap[] = { KOS_REG(r[0]), KOS_REG(r[1]), KOS_REG(r[2]), KOS_REG(r[3]), @@ -272,7 +264,7 @@ typedef struct { } stepData; -static uint32 *registers; +static irq_context_t *irq_ctx; static stepData instrBuffer; static char stepped; static const char hexchars[] = "0123456789abcdef"; @@ -525,7 +517,7 @@ static void doSStep(void) { int reg; unsigned short opcode, br_opcode; - instrMem = (short *) registers[PC]; + instrMem = (short *) irq_ctx->pc; opcode = *instrMem; stepped = 1; @@ -533,7 +525,7 @@ static void doSStep(void) { br_opcode = opcode & COND_BR_MASK; if(br_opcode == BT_INSTR || br_opcode == BTS_INSTR) { - if(registers[SR] & T_BIT_MASK) { + if(irq_ctx->sr & T_BIT_MASK) { displacement = (opcode & COND_DISP) << 1; if(displacement & 0x80) @@ -543,7 +535,7 @@ static void doSStep(void) { * Remember PC points to second instr. * after PC of branch ... so add 4 */ - instrMem = (short *)(registers[PC] + displacement + 4); + instrMem = (short *)(irq_ctx->pc + displacement + 4); } else { /* can't put a trapa in the delay slot of a bt/s instruction */ @@ -551,7 +543,7 @@ static void doSStep(void) { } } else if(br_opcode == BF_INSTR || br_opcode == BFS_INSTR) { - if(registers[SR] & T_BIT_MASK) { + if(irq_ctx->sr & T_BIT_MASK) { /* can't put a trapa in the delay slot of a bf/s instruction */ instrMem += (br_opcode == BFS_INSTR) ? 2 : 1; } @@ -565,7 +557,7 @@ static void doSStep(void) { * Remember PC points to second instr. * after PC of branch ... so add 4 */ - instrMem = (short *)(registers[PC] + displacement + 4); + instrMem = (short *)(irq_ctx->pc + displacement + 4); } } else if((opcode & UCOND_DBR_MASK) == BRA_INSTR) { @@ -578,17 +570,17 @@ static void doSStep(void) { * Remember PC points to second instr. * after PC of branch ... so add 4 */ - instrMem = (short *)(registers[PC] + displacement + 4); + instrMem = (short *)(irq_ctx->pc + displacement + 4); } else if((opcode & UCOND_RBR_MASK) == JSR_INSTR) { reg = (char)((opcode & UCOND_REG) >> 8); - instrMem = (short *) registers[reg]; + instrMem = (short *) irq_ctx->r[reg]; } else if(opcode == RTS_INSTR) - instrMem = (short *) registers[PR]; + instrMem = (short *) irq_ctx->pr; else if(opcode == RTE_INSTR) - instrMem = (short *) registers[15]; + instrMem = (short *) irq_ctx->r[15]; else if((opcode & TRAPA_MASK) == TRAPA_INSTR) instrMem = (short *)((opcode & ~TRAPA_MASK) << 2); else @@ -748,7 +740,7 @@ static void gdb_handle_exception(int exceptionVector) { char* outBuf = remcomOutBuffer; for(i = 0; i < NUMREGBYTES / 4; i++) - outBuf = mem2hex((char *)(registers + kosRegMap[i]), outBuf, 4); + outBuf = mem2hex((char *)((uint32)irq_ctx + kosRegMap[i]), outBuf, 4); } break; @@ -757,7 +749,7 @@ static void gdb_handle_exception(int exceptionVector) { char* inBuf = ptr; for(i = 0; i < NUMREGBYTES / 4; i++, inBuf += 8) - hex2mem(inBuf, (char *)(registers + kosRegMap[i]), 4); + hex2mem(inBuf, (char *)((uint32)irq_ctx + kosRegMap[i]), 4); strcpy(remcomOutBuffer, "OK"); } @@ -812,7 +804,7 @@ static void gdb_handle_exception(int exceptionVector) { case 'c': { /* tRY, to read optional parameter, pc unchanged if no param */ if(hexToInt(&ptr, &addr)) - registers[PC] = addr; + irq_ctx->pc = addr; if(stepping) doSStep(); @@ -914,14 +906,14 @@ static void flushDebugChannel(void) { static void handle_exception(irq_t code, irq_context_t *context, void *data) { (void)data; - registers = (uint32 *)context; + irq_ctx = context; gdb_handle_exception(code); } static void handle_user_trapa(irq_t code, irq_context_t *context, void *data) { (void)code; (void)data; - registers = (uint32 *)context; + irq_ctx = context; gdb_handle_exception(EXC_TRAPA); } @@ -934,8 +926,8 @@ static void handle_gdb_trapa(irq_t code, irq_context_t *context, void *data) { */ (void)code; (void)data; - registers = (uint32 *)context; - registers[PC] -= 2; + irq_ctx = context; + irq_ctx->pc -= 2; gdb_handle_exception(EXC_TRAPA); } diff --git a/utils/cmake/dreamcast.cmake b/utils/cmake/dreamcast.cmake index 607ace5c..4fff3a9c 100644 --- a/utils/cmake/dreamcast.cmake +++ b/utils/cmake/dreamcast.cmake @@ -1,4 +1,5 @@ -cmake_minimum_required(VERSION 3.23) +### This minimum is based on the minimum requirement in dreamcast.toolchain.cmake +cmake_minimum_required(VERSION 3.13) ### Helper Function for Bin2Object ### function(kos_bin2o inFile symbol) diff --git a/utils/cmake/dreamcast.toolchain.cmake b/utils/cmake/dreamcast.toolchain.cmake index 79a59e19..23071c9e 100644 --- a/utils/cmake/dreamcast.toolchain.cmake +++ b/utils/cmake/dreamcast.toolchain.cmake @@ -16,7 +16,8 @@ # The original toolchain file was created by Kazade for the Simulant # engine who has graciously allowed the rest of the scene to warez it. -cmake_minimum_required(VERSION 3.23) +#### This minimum is due to the use of add_link_options +cmake_minimum_required(VERSION 3.13) #### Set Configuration Variables From Environment #### if(NOT DEFINED KOS_BASE) hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-04-12 19:40:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via ede9ebfd0eb7ac0be7a787fed379a2e7baffcbf4 (commit) via 1df0c90c98ff7de94df3a06e10e7d90bd3da3934 (commit) via 523a88e8681c401c5ae486cca743e4edb53eaae1 (commit) from 0dc26b628cf49c8ec726c33d49325e0337f9bb35 (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 ede9ebfd0eb7ac0be7a787fed379a2e7baffcbf4 Author: Paul Cercueil <pa...@cr...> Date: Fri Apr 12 21:39:34 2024 +0200 maple: Add support for French AZERTY keyboards (#508) Signed-off-by: Paul Cercueil <pa...@cr...> commit 1df0c90c98ff7de94df3a06e10e7d90bd3da3934 Author: Falco Girgis <gyr...@gm...> Date: Tue Apr 9 19:34:50 2024 -0500 Added debug/assertion option to environ.sh.sample (#473) - We were never even exposing a mechanism through which the user could enable or disable assertions. Added one to environ.sh.sample, which defaults to having them enabled. commit 523a88e8681c401c5ae486cca743e4edb53eaae1 Author: kapodamy <168...@us...> Date: Tue Apr 9 18:18:39 2024 -0300 Update g2bus.h (#502) suppress warnings generated by -Wsign-conversion ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + doc/environ.sh.sample | 8 +++ kernel/arch/dreamcast/hardware/maple/keyboard.c | 60 +++++++++++++++++++++-- kernel/arch/dreamcast/include/dc/g2bus.h | 2 +- kernel/arch/dreamcast/include/dc/maple/keyboard.h | 2 +- 5 files changed, 66 insertions(+), 7 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 62cd90d8..d4801fa1 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -219,6 +219,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Implemented _POSIX_CPUTIME in clock_gettime() using perf counter timer [FG] - *** Implemented scandir() and alphasort() POSIX functions from dirent.h [FG] - DC Added new driver for the SH4's UBC + high-level breakpoint API [FG] +- DC Add support for French AZERTY keyboards [PC] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/doc/environ.sh.sample b/doc/environ.sh.sample index 17fc83a5..f53ad3a2 100644 --- a/doc/environ.sh.sample +++ b/doc/environ.sh.sample @@ -109,6 +109,14 @@ export KOS_LDFLAGS="" export KOS_AFLAGS="" export DC_ARM_LDFLAGS="" +# Debug Builds +# +# Controls whether to disable additional debugging checks and assertions, +# such as for parameter validation or internal errors. Uncomment this if +# you do not wish to compile with this additional logic enabled. +# +#export KOS_CFLAGS="${KOS_CFLAGS} -DNDEBUG" + # Optimization Level # # Controls the baseline optimization level to use when building. diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index df184310..cc5dbe4f 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -4,6 +4,7 @@ Copyright (C) 2002 Megan Potter Copyright (C) 2012 Lawrence Sebald Copyright (C) 2018 Donald Haase + Copyright (C) 2024 Paul Cercueil */ #include <assert.h> @@ -233,11 +234,60 @@ static kbd_keymap_t keymaps[KBD_NUM_KEYMAPS] = { } }, { - /* French/AZERTY keyboard, probably. This one needs to be confirmed - still. */ - { }, - { }, - { } + /* French/AZERTY keyboard */ + /* The hex values in the tables are the ISO-8859-15 representation of the + French special chars. */ + { + /* Base values */ + 0, 0, 0, 0, 'q', 'b', 'c', 'd', /* 0x00 - 0x07 */ + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', /* 0x08 - 0x0F */ + ',', 'n', 'o', 'p', 'a', 'r', 's', 't', /* 0x10 - 0x17 */ + 'u', 'v', 'z', 'x', 'y', 'w', '&', 0xe9, /* 0x18 - 0x1F */ + '\"', '\'', '(', '-', 0xe8, '_', 0xe7, 0xe0, /* 0x20 - 0x27 */ + 10, 27, 8, 9, ' ', ')', '=', '^', /* 0x28 - 0x2F */ + '$', 0, '*', 'm', 0xf9, 0xb2, ';', ':', /* 0x30 - 0x37 */ + '!', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, '/', '*', '-', '+', /* 0x50 - 0x57 */ + 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ + '8', '9', '0', '.', 0, 0 /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + }, + { + /* Shifted values */ + 0, 0, 0, 0, 'Q', 'B', 'C', 'D', /* 0x00 - 0x07 */ + 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', /* 0x08 - 0x0F */ + '?', 'N', 'O', 'P', 'A', 'R', 'S', 'T', /* 0x10 - 0x17 */ + 'U', 'V', 'Z', 'X', 'Y', 'W', '1', '2', /* 0x18 - 0x1F */ + '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ + 10, 27, 8, 9, ' ', 0xba, '+', 0, /* 0x28 - 0x2F */ + 0xa3, 0, 0xb5, 'M', '%', 0xb3, '.', '/', /* 0x30 - 0x37 */ + 0x7a, 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, '/', '*', '-', '+', /* 0x50 - 0x57 */ + 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ + '8', '9', '0', '.', 0, 0 /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + }, + { + /* "Alt" shifted values */ + 0, 0, 0, 0, 0xe4, 0, 0xa9, 0, /* 0x00 - 0x07 */ + 0xa4, 0, 0, 0, 0xee, 0xfc, 0xef, 0, /* 0x08 - 0x0F */ + 0xbf, 0xf1, 0xbd, 0xf4, 0xe6, 0xea, 0xdf, 0, /* 0x10 - 0x17 */ + 0xfb, 0, 0xe2, 0xbb, 0xfc, 0xab, 0, 0, /* 0x18 - 0x1F */ + '#', '{', '[', '|', 0, '\\', '^', '@', /* 0x20 - 0x27 */ + 10, 27, 8, 9, ' ', ']', '}', '~', /* 0x28 - 0x2F */ + 0, 0, 0, 0xf6, 0, 0xb9, 0xd7, 0xf7, /* 0x30 - 0x37 */ + 0xa1, 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, '/', '*', '-', '+', /* 0x50 - 0x57 */ + 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ + '8', '9', '0', '.', 0, 0 /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + } }, { /* Italian/QWERTY keyboard, probably. This one needs to be confirmed diff --git a/kernel/arch/dreamcast/include/dc/g2bus.h b/kernel/arch/dreamcast/include/dc/g2bus.h index 1f921cc2..465938d1 100644 --- a/kernel/arch/dreamcast/include/dc/g2bus.h +++ b/kernel/arch/dreamcast/include/dc/g2bus.h @@ -140,7 +140,7 @@ void g2_dma_shutdown(void); is used in with g2_lock() and g2_unlock(). */ typedef struct { - uint32_t irq_state; /** \brief IRQ state when entering a G2 critical block */ + int irq_state; /** \brief IRQ state when entering a G2 critical block */ } g2_ctx_t; /* Internal constants to access suspend registers for G2 DMA. They are not meant for diff --git a/kernel/arch/dreamcast/include/dc/maple/keyboard.h b/kernel/arch/dreamcast/include/dc/maple/keyboard.h index fea99ff9..51be9173 100644 --- a/kernel/arch/dreamcast/include/dc/maple/keyboard.h +++ b/kernel/arch/dreamcast/include/dc/maple/keyboard.h @@ -190,7 +190,7 @@ __BEGIN_DECLS #define KBD_REGION_US 2 /**< \brief US keyboard */ #define KBD_REGION_UK 3 /**< \brief UK keyboard */ #define KBD_REGION_DE 4 /**< \brief German keyboard */ -#define KBD_REGION_FR 5 /**< \brief French keyboard (not supported yet) */ +#define KBD_REGION_FR 5 /**< \brief French keyboard */ #define KBD_REGION_IT 6 /**< \brief Italian keyboard (not supported yet) */ #define KBD_REGION_ES 7 /**< \brief Spanish keyboard */ /** @} */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2024-04-04 00:05:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 0dc26b628cf49c8ec726c33d49325e0337f9bb35 (commit) via 023543154237199120b9f9380aab455258af7176 (commit) from 437c662388de933fabaf472603dd358cc8ba2c28 (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 0dc26b628cf49c8ec726c33d49325e0337f9bb35 Merge: 437c6623 02354315 Author: Lawrence Sebald <ljs...@us...> Date: Wed Apr 3 20:03:41 2024 -0400 Merge pull request #500 from KallistiOS/gcc14cppfix Adjust GCC 14 patch to fix libstdc++ compilation with m4-single-only commit 023543154237199120b9f9380aab455258af7176 Author: darc <da...@pr...> Date: Wed Apr 3 17:50:41 2024 -0500 Adjust GCC 14 patch to fix libstdc++ compilation with m4-single-only ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/config/config.mk.14.0.1-dev.sample | 2 +- utils/dc-chain/patches/gcc-14.0.1-kos.diff | 59 ++++++++++++++++++++++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/utils/dc-chain/config/config.mk.14.0.1-dev.sample b/utils/dc-chain/config/config.mk.14.0.1-dev.sample index 2bc94b07..5e618552 100644 --- a/utils/dc-chain/config/config.mk.14.0.1-dev.sample +++ b/utils/dc-chain/config/config.mk.14.0.1-dev.sample @@ -8,7 +8,7 @@ ############################################################################### ############################################################################### ### THIS CONFIG IS FOR AN EXPERIMENTAL VERSION OF GCC! -## THERE ARE NO KNOWN ISSUES BUILDING THIS VERSION as of 2024-02-10. +## THERE ARE NO KNOWN ISSUES BUILDING THIS VERSION as of 2024-04-03. ############################################################################### ############################################################################### diff --git a/utils/dc-chain/patches/gcc-14.0.1-kos.diff b/utils/dc-chain/patches/gcc-14.0.1-kos.diff index 845be0a5..6436865f 100644 --- a/utils/dc-chain/patches/gcc-14.0.1-kos.diff +++ b/utils/dc-chain/patches/gcc-14.0.1-kos.diff @@ -152,7 +152,7 @@ diff -ruN gcc-14.0.1/libstdc++-v3/config/cpu/sh/atomicity.h gcc-14.0.1-kos/libst diff -ruN gcc-14.0.1/libstdc++-v3/configure gcc-14.0.1-kos/libstdc++-v3/configure --- gcc-14.0.1/libstdc++-v3/configure 2024-01-04 16:01:37.616069648 -0600 +++ gcc-14.0.1-kos/libstdc++-v3/configure 2024-01-04 16:01:42.919094508 -0600 -@@ -15959,6 +15959,7 @@ +@@ -15974,6 +15974,7 @@ tpf) thread_header=config/s390/gthr-tpf.h ;; vxworks) thread_header=config/gthr-vxworks.h ;; win32) thread_header=config/i386/gthr-win32.h ;; @@ -160,3 +160,60 @@ diff -ruN gcc-14.0.1/libstdc++-v3/configure gcc-14.0.1-kos/libstdc++-v3/configur mcf) thread_header=config/i386/gthr-mcf.h ;; esac +diff --color -ruN gcc-14.0.1/libstdc++-v3/include/bits/chrono_io.h gcc-14.0.1-kos/libstdc++-v3/include/bits/chrono_io.h +--- gcc-14.0.1/libstdc++-v3/include/bits/chrono_io.h 2024-04-03 17:15:23.218387908 -0500 ++++ gcc-14.0.1-kos/libstdc++-v3/include/bits/chrono_io.h 2024-04-03 17:26:31.045952218 -0500 +@@ -37,7 +37,6 @@ + #include <sstream> // ostringstream + #include <iomanip> // setw, setfill + #include <format> +-#include <charconv> // from_chars + + #include <bits/streambuf_iterator.h> + +@@ -3657,17 +3656,13 @@ + __err |= ios_base::eofbit; + else + { +- _CharT __dp = '.'; +- if (__loc != locale::classic()) +- { +- auto& __np = use_facet<numpunct<_CharT>>(__loc); +- __dp = __np.decimal_point(); +- } ++ auto& __np = use_facet<numpunct<_CharT>>(__loc); ++ auto __dp = __np.decimal_point(); + _CharT __c = _Traits::to_char_type(__i); + if (__c == __dp) + { + (void) __is.get(); +- __buf.put('.'); ++ __buf.put(__c); + int __prec + = hh_mm_ss<_Duration>::fractional_width; + do +@@ -3682,17 +3677,14 @@ + } + } + +- if (!__is_failed(__err)) [[likely]] ++ if (!__is_failed(__err)) + { +- long double __val{}; +- string __str = std::move(__buf).str(); +- auto __first = __str.data(); +- auto __last = __first + __str.size(); +- using enum chars_format; +- auto [ptr, ec] = std::from_chars(__first, __last, +- __val, fixed); +- if ((bool)ec || ptr != __last) [[unlikely]] +- __err |= ios_base::failbit; ++ auto& __ng = use_facet<num_get<_CharT>>(__loc); ++ long double __val; ++ ios_base::iostate __err2{}; ++ __ng.get(__buf, {}, __buf, __err2, __val); ++ if (__is_failed(__err2)) [[unlikely]] ++ __err |= __err2; + else + { + duration<long double> __fs(__val); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |