From: quzar <qu...@us...> - 2025-05-07 12:55: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 1aaa930bf1050ef8116bf23527eba95a16da6efb (commit) via 5607a3e0e0da992d0780e6ab8920788970faaed7 (commit) from 0d7f67c472aa4b8eef910aba339f247fde3b2134 (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 1aaa930bf1050ef8116bf23527eba95a16da6efb Author: DC-SWAT <sw...@21...> Date: Wed May 7 11:06:10 2025 +0700 sd: Optimized reading and writing sectors on SCIF-SPI. About ~10% increase for reading. commit 5607a3e0e0da992d0780e6ab8920788970faaed7 Author: SiZiOUS <si...@gm...> Date: Tue Apr 29 21:59:12 2025 +0200 `dc-chain`: adding GCC 9.5.0 patches for MinGW-w64/MSYS2 Adding for both MinGW-w64 32-bit (`i686-w64-mingw32`, aka `mingw32`) and for MinGW-w64 64-bit (`x86_64-w64-mingw32` aka `mingw64`). ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/sd.c | 18 +- .../patches/i686-w64-mingw32/gcc-9.5.0.diff | 2810 ++++++++++++++++++++ .../patches/x86_64-w64-mingw32/gcc-9.5.0.diff | 2810 ++++++++++++++++++++ 3 files changed, 5627 insertions(+), 11 deletions(-) create mode 100644 utils/dc-chain/patches/i686-w64-mingw32/gcc-9.5.0.diff create mode 100644 utils/dc-chain/patches/x86_64-w64-mingw32/gcc-9.5.0.diff diff --git a/kernel/arch/dreamcast/hardware/sd.c b/kernel/arch/dreamcast/hardware/sd.c index ca6b8af8..c687f9a2 100644 --- a/kernel/arch/dreamcast/hardware/sd.c +++ b/kernel/arch/dreamcast/hardware/sd.c @@ -305,8 +305,6 @@ int sd_shutdown(void) { } static int read_data(size_t bytes, uint8 *buf) { - uint8 *ptr = buf; - size_t cnt = bytes; uint8 byte; uint16 crc; int i = 0; @@ -321,12 +319,10 @@ static int read_data(size_t bytes, uint8 *buf) { return -1; /* Read in the data */ - while(cnt--) { - *ptr++ = scif_spi_rw_byte(0xFF); - } + scif_spi_read_data(buf, bytes); /* Read in the trailing CRC */ - crc = (scif_spi_rw_byte(0xFF) << 8) | scif_spi_rw_byte(0xFF); + crc = (scif_spi_read_byte() << 8) | scif_spi_read_byte(); /* Return success if the CRC matches */ return crc != net_crc16ccitt(buf, bytes, 0); @@ -406,20 +402,20 @@ static int write_data(uint8 tag, size_t bytes, const uint8 *buf) { if(rv != 0xFF) return -1; - scif_spi_rw_byte(tag); + scif_spi_write_byte(tag); /* Send the data. */ crc = net_crc16ccitt(buf, bytes, 0); while(bytes--) { - scif_spi_rw_byte(*ptr++); + scif_spi_write_byte(*ptr++); } /* Write out the block's crc */ - scif_spi_rw_byte((uint8)(crc >> 8)); - scif_spi_rw_byte((uint8)crc); + scif_spi_write_byte((uint8)(crc >> 8)); + scif_spi_write_byte((uint8)crc); /* Make sure the card accepted the block */ - rv = scif_spi_rw_byte(0xFF); + rv = scif_spi_read_byte(); if((rv & 0x1F) != 0x05) return -1; diff --git a/utils/dc-chain/patches/i686-w64-mingw32/gcc-9.5.0.diff b/utils/dc-chain/patches/i686-w64-mingw32/gcc-9.5.0.diff new file mode 100644 index 00000000..1fe0980b --- /dev/null +++ b/utils/dc-chain/patches/i686-w64-mingw32/gcc-9.5.0.diff @@ -0,0 +1,2810 @@ +diff -ruN gcc-9.5.0/gcc/ada/adaint.c gcc-9.5.0-patched/gcc/ada/adaint.c +--- gcc-9.5.0/gcc/ada/adaint.c 2022-05-27 09:21:10.583377700 +0200 ++++ gcc-9.5.0-patched/gcc/ada/adaint.c 2025-04-28 14:41:55.127009100 +0200 +@@ -192,6 +192,7 @@ + + #elif defined (_WIN32) + ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <accctrl.h> + #include <aclapi.h> +diff -ruN gcc-9.5.0/gcc/ada/cio.c gcc-9.5.0-patched/gcc/ada/cio.c +--- gcc-9.5.0/gcc/ada/cio.c 2022-05-27 09:21:10.595377700 +0200 ++++ gcc-9.5.0-patched/gcc/ada/cio.c 2025-04-28 14:41:55.131917000 +0200 +@@ -68,6 +68,7 @@ + #endif + + #ifdef RTX ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <Rtapi.h> + #endif +diff -ruN gcc-9.5.0/gcc/ada/ctrl_c.c gcc-9.5.0-patched/gcc/ada/ctrl_c.c +--- gcc-9.5.0/gcc/ada/ctrl_c.c 2022-05-27 09:21:10.595377700 +0200 ++++ gcc-9.5.0-patched/gcc/ada/ctrl_c.c 2025-04-28 14:41:55.136067500 +0200 +@@ -131,6 +131,7 @@ + #elif defined (__MINGW32__) + + #include "mingw32.h" ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + void (*sigint_intercepted) (void) = NULL; +diff -ruN gcc-9.5.0/gcc/ada/expect.c gcc-9.5.0-patched/gcc/ada/expect.c +--- gcc-9.5.0/gcc/ada/expect.c 2022-05-27 09:21:10.651378000 +0200 ++++ gcc-9.5.0-patched/gcc/ada/expect.c 2025-04-28 14:41:55.140700100 +0200 +@@ -77,6 +77,7 @@ + + #ifdef _WIN32 + ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <process.h> + #include <signal.h> +diff -ruN gcc-9.5.0/gcc/ada/gsocket.h gcc-9.5.0-patched/gcc/ada/gsocket.h +--- gcc-9.5.0/gcc/ada/gsocket.h 2022-05-27 09:21:10.683378200 +0200 ++++ gcc-9.5.0-patched/gcc/ada/gsocket.h 2025-04-28 14:41:55.145733600 +0200 +@@ -166,6 +166,7 @@ + + #endif + ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + #elif defined(VMS) +diff -ruN gcc-9.5.0/gcc/ada/mingw32.h gcc-9.5.0-patched/gcc/ada/mingw32.h +--- gcc-9.5.0/gcc/ada/mingw32.h 2022-05-27 09:21:10.759378500 +0200 ++++ gcc-9.5.0-patched/gcc/ada/mingw32.h 2025-04-28 14:41:55.148804700 +0200 +@@ -58,6 +58,7 @@ + #define _X86INTRIN_H_INCLUDED + #define _EMMINTRIN_H_INCLUDED + #endif ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + /* After including this file it is possible to use the character t as prefix +diff -ruN gcc-9.5.0/gcc/ada/mkdir.c gcc-9.5.0-patched/gcc/ada/mkdir.c +--- gcc-9.5.0/gcc/ada/mkdir.c 2022-05-27 09:21:10.759378500 +0200 ++++ gcc-9.5.0-patched/gcc/ada/mkdir.c 2025-04-28 14:41:55.153885500 +0200 +@@ -45,6 +45,7 @@ + + #ifdef __MINGW32__ + #include "mingw32.h" ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #ifdef MAXPATHLEN + #define GNAT_MAX_PATH_LEN MAXPATHLEN +diff -ruN gcc-9.5.0/gcc/ada/rtfinal.c gcc-9.5.0-patched/gcc/ada/rtfinal.c +--- gcc-9.5.0/gcc/ada/rtfinal.c 2022-05-27 09:21:10.771378600 +0200 ++++ gcc-9.5.0-patched/gcc/ada/rtfinal.c 2025-04-28 14:41:55.166223600 +0200 +@@ -47,6 +47,7 @@ + + #if defined (__MINGW32__) + #include "mingw32.h" ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + extern CRITICAL_SECTION ProcListCS; +diff -ruN gcc-9.5.0/gcc/ada/rtinit.c gcc-9.5.0-patched/gcc/ada/rtinit.c +--- gcc-9.5.0/gcc/ada/rtinit.c 2022-05-27 09:21:10.771378600 +0200 ++++ gcc-9.5.0-patched/gcc/ada/rtinit.c 2025-04-28 14:41:55.172726400 +0200 +@@ -73,6 +73,7 @@ + + #if defined (__MINGW32__) + #include "mingw32.h" ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + extern void __gnat_init_float (void); +diff -ruN gcc-9.5.0/gcc/ada/seh_init.c gcc-9.5.0-patched/gcc/ada/seh_init.c +--- gcc-9.5.0/gcc/ada/seh_init.c 2022-05-27 09:21:10.775378600 +0200 ++++ gcc-9.5.0-patched/gcc/ada/seh_init.c 2025-04-28 14:41:55.177886600 +0200 +@@ -34,6 +34,7 @@ + + #if defined (_WIN32) || (defined (__CYGWIN__) && defined (__SEH__)) + /* Include system headers, before system.h poisons malloc. */ ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <excpt.h> + #endif +diff -ruN gcc-9.5.0/gcc/ada/sysdep.c gcc-9.5.0-patched/gcc/ada/sysdep.c +--- gcc-9.5.0/gcc/ada/sysdep.c 2022-05-27 09:21:10.843378900 +0200 ++++ gcc-9.5.0-patched/gcc/ada/sysdep.c 2025-04-28 14:41:55.183945700 +0200 +@@ -215,6 +215,7 @@ + #endif /* __CYGWIN__ */ + + #if defined (__CYGWIN__) || defined (__MINGW32__) ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + int __gnat_is_windows_xp (void); +@@ -591,6 +592,7 @@ + Ada programs. */ + + #ifdef WINNT ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + /* Provide functions to echo the values passed to WinMain (windows bindings +diff -ruN gcc-9.5.0/gcc/ada/terminals.c gcc-9.5.0-patched/gcc/ada/terminals.c +--- gcc-9.5.0/gcc/ada/terminals.c 2022-05-27 09:21:10.843378900 +0200 ++++ gcc-9.5.0-patched/gcc/ada/terminals.c 2025-04-28 14:41:55.191540000 +0200 +@@ -151,6 +151,7 @@ + #include <stdio.h> + #include <stdlib.h> + ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + #define MAXPATHLEN 1024 +diff -ruN gcc-9.5.0/gcc/ada/tracebak.c gcc-9.5.0-patched/gcc/ada/tracebak.c +--- gcc-9.5.0/gcc/ada/tracebak.c 2022-05-27 09:21:10.843378900 +0200 ++++ gcc-9.5.0-patched/gcc/ada/tracebak.c 2025-04-28 14:41:55.197690500 +0200 +@@ -97,6 +97,7 @@ + + #if defined (_WIN64) && defined (__SEH__) + ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + #define IS_BAD_PTR(ptr) (IsBadCodePtr((FARPROC)ptr)) +@@ -444,6 +445,7 @@ + #elif defined (__i386__) || defined (__x86_64__) + + #if defined (__WIN32) ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #define IS_BAD_PTR(ptr) (IsBadCodePtr((FARPROC)ptr)) + #elif defined (__sun__) +diff -ruN gcc-9.5.0/gcc/d/dmd/root/file.c gcc-9.5.0-patched/gcc/d/dmd/root/file.c +--- gcc-9.5.0/gcc/d/dmd/root/file.c 2022-05-27 09:21:11.147380400 +0200 ++++ gcc-9.5.0-patched/gcc/d/dmd/root/file.c 2025-04-28 14:41:55.254807300 +0200 +@@ -10,6 +10,7 @@ + #include "file.h" + + #if _WIN32 ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #endif + +diff -ruN gcc-9.5.0/gcc/d/dmd/root/filename.c gcc-9.5.0-patched/gcc/d/dmd/root/filename.c +--- gcc-9.5.0/gcc/d/dmd/root/filename.c 2022-05-27 09:21:11.147380400 +0200 ++++ gcc-9.5.0-patched/gcc/d/dmd/root/filename.c 2025-04-28 14:41:55.261719800 +0200 +@@ -15,6 +15,7 @@ + #include "rmem.h" + + #if _WIN32 ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #endif + +diff -ruN gcc-9.5.0/gcc/diagnostic-color.c gcc-9.5.0-patched/gcc/diagnostic-color.c +--- gcc-9.5.0/gcc/diagnostic-color.c 2022-05-27 09:21:11.155380500 +0200 ++++ gcc-9.5.0-patched/gcc/diagnostic-color.c 2025-04-28 14:41:55.268542100 +0200 +@@ -21,6 +21,7 @@ + #include "diagnostic-color.h" + + #ifdef __MINGW32__ ++# define WIN32_LEAN_AND_MEAN + # include <windows.h> + #endif + +diff -ruN gcc-9.5.0/gcc/prefix.c gcc-9.5.0-patched/gcc/prefix.c +--- gcc-9.5.0/gcc/prefix.c 2022-05-27 09:21:11.703383200 +0200 ++++ gcc-9.5.0-patched/gcc/prefix.c 2025-04-28 14:41:55.290110200 +0200 +@@ -67,6 +67,7 @@ + #include "system.h" + #include "coretypes.h" + #if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY) ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #endif + #include "prefix.h" +diff -ruN gcc-9.5.0/gcc/testsuite/g++.dg/asan/sanitizer_test_utils.h gcc-9.5.0-patched/gcc/testsuite/g++.dg/asan/sanitizer_test_utils.h +--- gcc-9.5.0/gcc/testsuite/g++.dg/asan/sanitizer_test_utils.h 2022-05-27 09:21:11.851383900 +0200 ++++ gcc-9.5.0-patched/gcc/testsuite/g++.dg/asan/sanitizer_test_utils.h 2025-04-28 14:41:55.307048000 +0200 +@@ -15,6 +15,7 @@ + + #if defined(_WIN32) + // <windows.h> should always be the first include on Windows. ++# define WIN32_LEAN_AND_MEAN + # include <windows.h> + // MSVS headers define max/min as macros, so std::max/min gets crazy. + # undef max +diff -ruN gcc-9.5.0/gcc/testsuite/gcc.dg/di-sync-multithread.c gcc-9.5.0-patched/gcc/testsuite/gcc.dg/di-sync-multithread.c +--- gcc-9.5.0/gcc/testsuite/gcc.dg/di-sync-multithread.c 2022-05-27 09:21:12.151385400 +0200 ++++ gcc-9.5.0-patched/gcc/testsuite/gcc.dg/di-sync-multithread.c 2025-04-28 14:41:55.313904000 +0200 +@@ -11,6 +11,7 @@ + #include <pthread.h> + #include <unistd.h> + #ifdef _WIN32 ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #endif + +diff -ruN gcc-9.5.0/gcc/testsuite/gcc.dg/format/ms-format3.c gcc-9.5.0-patched/gcc/testsuite/gcc.dg/format/ms-format3.c +--- gcc-9.5.0/gcc/testsuite/gcc.dg/format/ms-format3.c 2022-05-27 09:21:12.155385400 +0200 ++++ gcc-9.5.0-patched/gcc/testsuite/gcc.dg/format/ms-format3.c 2025-04-28 14:41:55.321098100 +0200 +@@ -8,6 +8,7 @@ + #define USE_SYSTEM_FORMATS + #define WIN32_LEAN_AND_MEAN + #include "format.h" ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + void foo (LONG_PTR l, ULONG_PTR u, DWORD_PTR d, UINT_PTR p, SIZE_T s) +diff -ruN gcc-9.5.0/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h gcc-9.5.0-patched/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h +--- gcc-9.5.0/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h 2022-05-27 09:21:12.711388100 +0200 ++++ gcc-9.5.0-patched/gcc/testsuite/objc-obj-c++-shared/GNUStep/GNUstepBase/GSConfig.h 2025-04-28 21:56:15.339515200 +0200 +@@ -307,6 +307,7 @@ + #define WINVER Windows2000 + #endif + ++#define WIN32_LEAN_AND_MEAN + #if defined(__WIN64__) + #include <winsock2.h> + #include <windows.h> +diff -ruN gcc-9.5.0/libatomic/config/mingw/lock.c gcc-9.5.0-patched/libatomic/config/mingw/lock.c +--- gcc-9.5.0/libatomic/config/mingw/lock.c 2022-05-27 09:21:12.803388500 +0200 ++++ gcc-9.5.0-patched/libatomic/config/mingw/lock.c 2025-04-28 14:41:55.353547500 +0200 +@@ -23,6 +23,7 @@ + <http://www.gnu.org/licenses/>. */ + + #define UWORD __shadow_UWORD ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #undef UWORD + #include "libatomic_i.h" +diff -ruN gcc-9.5.0/libcpp/system.h gcc-9.5.0-patched/libcpp/system.h +--- gcc-9.5.0/libcpp/system.h 2022-05-27 09:21:12.835388700 +0200 ++++ gcc-9.5.0-patched/libcpp/system.h 2025-04-28 21:58:28.654156400 +0200 +@@ -272,7 +272,9 @@ + #endif + + #ifndef HAVE_SETLOCALE +-# define setlocale(category, locale) (locale) ++# ifndef ENABLE_NLS ++# define setlocale(category, locale) (locale) ++# endif + #endif + + #ifdef ENABLE_NLS +diff -ruN gcc-9.5.0/libffi/src/x86/darwin_c.c gcc-9.5.0-patched/libffi/src/x86/darwin_c.c +--- gcc-9.5.0/libffi/src/x86/darwin_c.c 2022-05-27 09:21:12.851388800 +0200 ++++ gcc-9.5.0-patched/libffi/src/x86/darwin_c.c 2025-04-28 14:41:55.366580200 +0200 +@@ -31,6 +31,7 @@ + #if !defined(__x86_64__) || defined(_WIN64) || defined(__CYGWIN__) + + #ifdef _WIN64 ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #endif + +diff -ruN gcc-9.5.0/libgcc/config/i386/enable-execute-stack-mingw32.c gcc-9.5.0-patched/libgcc/config/i386/enable-execute-stack-mingw32.c +--- gcc-9.5.0/libgcc/config/i386/enable-execute-stack-mingw32.c 2022-05-27 09:21:12.867388900 +0200 ++++ gcc-9.5.0-patched/libgcc/config/i386/enable-execute-stack-mingw32.c 2025-04-28 14:41:55.380079700 +0200 +@@ -22,6 +22,7 @@ + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + + extern void __enable_execute_stack (void *); +diff -ruN gcc-9.5.0/libgcc/config/i386/gthr-win32.c gcc-9.5.0-patched/libgcc/config/i386/gthr-win32.c +--- gcc-9.5.0/libgcc/config/i386/gthr-win32.c 2022-05-27 09:21:12.867388900 +0200 ++++ gcc-9.5.0-patched/libgcc/config/i386/gthr-win32.c 2025-04-28 14:41:55.384272800 +0200 +@@ -27,6 +27,7 @@ + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #ifndef __GTHREAD_HIDE_WIN32API + # define __GTHREAD_HIDE_WIN32API 1 +diff -ruN gcc-9.5.0/libgcc/config/i386/gthr-win32.h gcc-9.5.0-patched/libgcc/config/i386/gthr-win32.h +--- gcc-9.5.0/libgcc/config/i386/gthr-win32.h 2022-05-27 09:21:12.867388900 +0200 ++++ gcc-9.5.0-patched/libgcc/config/i386/gthr-win32.h 2025-04-28 14:41:55.390564800 +0200 +@@ -82,6 +82,7 @@ + #ifndef __OBJC__ + #define __OBJC__ + #endif ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + /* Now undef the windows BOOL. */ + #undef BOOL +@@ -546,6 +547,7 @@ + #else /* ! __GTHREAD_HIDE_WIN32API */ + + #define NOGDI ++#define WIN32_LEAN_AND_MEAN + #include <windows.h> + #include <errno.h> + +diff -ruN gcc-9.5.0/libgcc/config/sh/crt1.S gcc-9.5.0-patched/libgcc/config/sh/crt1.S +--- gcc-9.5.0/libgcc/config/sh/crt1.S 2022-05-27 09:21:12.907389100 +0200 ++++ gcc-9.5.0-patched/libgcc/config/sh/crt1.S 2025-04-28 22:00:31.971574600 +0200 +@@ -1,724 +1,724 @@ +-/* Copyright (C) 2000-2019 Free Software Foundation, Inc. +- This file was pretty much copied from newlib. +- +-This file is part of GCC. +- +-GCC is free software; you can redistribute it and/or modify it +-under the terms of the GNU General Public License as published by the +-Free Software Foundation; either version 3, or (at your option) any +-later version. +- +-GCC is distributed in the hope that it will be useful, +-but WITHOUT ANY WARRANTY; without even the implied warranty of +-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-General Public License for more details. +- +-Under Section 7 of GPL version 3, you are granted additional +-permissions described in the GCC Runtime Library Exception, version +-3.1, as published by the Free Software Foundation. +- +-You should have received a copy of the GNU General Public License and +-a copy of the GCC Runtime Library Exception along with this program; +-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +-<http://www.gnu.org/licenses/>. */ +- +-#include "crt.h" +- +-#ifdef MMU_SUPPORT +- /* Section used for exception/timer interrupt stack area */ +- .section .data.vbr.stack,"aw" +- .align 4 +- .global __ST_VBR +-__ST_VBR: +- .zero 1024 * 2 /* ; 2k for VBR handlers */ +-/* Label at the highest stack address where the stack grows from */ +-__timer_stack: +-#endif /* MMU_SUPPORT */ +- +- /* ;---------------------------------------- +- Normal newlib crt1.S */ +- +- ! make a place to keep any previous value of the vbr register +- ! this will only have a value if it has been set by redboot (for example) +- .section .bss +-old_vbr: +- .long 0 +-#ifdef PROFILE +-profiling_enabled: +- .long 0 +-#endif +- +- +- .section .text +- .global start +- .import ___rtos_profiler_start_timer +- .weak ___rtos_profiler_start_timer +-start: +- mov.l stack_k,r15 +- +-#if defined (__SH3__) || (defined (__SH_FPU_ANY__) && ! defined (__SH2E__) && ! defined (__SH2A__)) || defined (__SH4_NOFPU__) +-#define VBR_SETUP +- ! before zeroing the bss ... +- ! if the vbr is already set to vbr_start then the program has been restarted +- ! (i.e. it is not the first time the program has been run since reset) +- ! reset the vbr to its old value before old_vbr (in bss) is wiped +- ! this ensures that the later code does not create a circular vbr chain +- stc vbr, r1 +- mov.l vbr_start_k, r2 +- cmp/eq r1, r2 +- bf 0f +- ! reset the old vbr value +- mov.l old_vbr_k, r1 +- mov.l @r1, r2 +- ldc r2, vbr +-0: +-#endif /* VBR_SETUP */ +- +- ! zero out bss +- mov.l edata_k,r0 +- mov.l end_k,r1 +- mov #0,r2 +-start_l: +- mov.l r2,@r0 +- add #4,r0 +- cmp/ge r0,r1 +- bt start_l +- +-#if defined (__SH_FPU_ANY__) +- mov.l set_fpscr_k, r1 +- mov #4,r4 +- jsr @r1 +- shll16 r4 ! Set DN bit (flush denormal inputs to zero) +- lds r3,fpscr ! Switch to default precision +-#endif /* defined (__SH_FPU_ANY__) */ +- +-#ifdef VBR_SETUP +- ! save the existing contents of the vbr +- ! there will only be a prior value when using something like redboot +- ! otherwise it will be zero +- stc vbr, r1 +- mov.l old_vbr_k, r2 +- mov.l r1, @r2 +- ! setup vbr +- mov.l vbr_start_k, r1 +- ldc r1,vbr +-#endif /* VBR_SETUP */ +- +- ! if an rtos is exporting a timer start fn, +- ! then pick up an SR which does not enable ints +- ! (the rtos will take care of this) +- mov.l rtos_start_fn, r0 +- mov.l sr_initial_bare, r1 +- tst r0, r0 +- bt set_sr +- +- mov.l sr_initial_rtos, r1 +- +-set_sr: ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |