From: kosmirror <kos...@us...> - 2025-09-20 03:52:07
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 29147166323bb4cd5d5279c8b6fb17cc4128f65c (commit) via 1b25ccf992b01266c136f7f4cabd9e43499867ee (commit) via a155e806a420b66d61365d858c93be9e3394f8ce (commit) via a01ed5dcc9a79efcd7acbb9184ef518fcbc5484c (commit) via d039cafaaee08ded731c1f74cbf397fb62fe0d34 (commit) via 4327aaf000f39cc31d42a42099da79a2c7f3081e (commit) via 527e0fdc516739e44a76651e93359b25f70bebf8 (commit) via 228ccc0014fb99dc24095bc0d11501328c0d8ae1 (commit) via 399d89a0b27d473033b62fab4784afd1aff63c51 (commit) via 0b5e4c8939f9bd58061bd04542060699a99bb3d6 (commit) via 9e77aa19ba54c31ffd336386c253494e879d7797 (commit) via c3779fa61906deb0255211f7913e62df69e121e8 (commit) via 40e8394ae4d1c0a38ffe608917b1de49b04a199e (commit) from 7346fd704ba489b7d9cf1234282b85957e7625dc (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 29147166323bb4cd5d5279c8b6fb17cc4128f65c Author: Paul Cercueil <pa...@cr...> Date: Fri Sep 19 12:08:00 2025 +0200 treewide: Include <kos/timer.h> instead of <arch/timer.h> Use the top-level API file <kos/timer.h> everywhere where it makes sense. Signed-off-by: Paul Cercueil <pa...@cr...> commit 1b25ccf992b01266c136f7f4cabd9e43499867ee Author: Paul Cercueil <pa...@cr...> Date: Fri Sep 19 12:00:15 2025 +0200 timer: Re-introduce timer_spin_sleep() as a deprecated API function Maintain compatibility with old code by re-introducing timer_spin_sleep(), but in the top-level API this time, and implemented on top of the arch API. Tag is as deprecated, since thd_sleep() should really be used instead. Signed-off-by: Paul Cercueil <pa...@cr...> commit a155e806a420b66d61365d858c93be9e3394f8ce Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 23:12:46 2025 +0200 timer: Move older API functions to arch-agnostic header Move the timer_XX_gettime() and timer_XX_gettime64() functions from the SH4-specific timer code, to be arch-agnostic inline wrappers around the new timer_gettime() function. Also move timer_spin_delay_XX() functions to be arch-agnostic inline functions that just use the other ones above. Signed-off-by: Paul Cercueil <pa...@cr...> commit a01ed5dcc9a79efcd7acbb9184ef518fcbc5484c Author: Paul Cercueil <pa...@cr...> Date: Tue Jul 22 20:44:09 2025 +0200 timer: Add new arch-agnostic API function timer_gettime() Add API function timer_gettime(). This function will simply call arch_timer_gettime(), which has to be implemented by all the platforms supported by KallistiOS. Signed-off-by: Paul Cercueil <pa...@cr...> commit d039cafaaee08ded731c1f74cbf397fb62fe0d34 Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 14:32:06 2025 +0200 timer: Add function arch_timer_gettime() This function can be used to return the time since KOS was started, in a standard timespec format (number of seconds + number of nanoseconds). Signed-off-by: Paul Cercueil <pa...@cr...> commit 4327aaf000f39cc31d42a42099da79a2c7f3081e Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 14:30:10 2025 +0200 timer: Add arch function __dreamcast_get_ticks() This function returns the number of seconds since boot, and the number of ticks in the current second. It will later be used to implement the Dreamcast-specific implementation of the generic timer functions. Signed-off-by: Paul Cercueil <pa...@cr...> commit 527e0fdc516739e44a76651e93359b25f70bebf8 Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 14:59:25 2025 +0200 timer: Use compile-time-known offset for TNS array Instead of reading back the scaling factor (TPSC value) from the hardware registers and use it as the offset into the TNS array, use the compile-time-known TIMER_TPSC macro as the offset, because we know for sure this is the same value. The compiler will then be able to optimize the code better. Signed-off-by: Paul Cercueil <pa...@cr...> commit 228ccc0014fb99dc24095bc0d11501328c0d8ae1 Author: Paul Cercueil <pa...@cr...> Date: Tue Jul 29 18:17:24 2025 +0200 timer: Drop timer_ms_{enable,disable} Those functions serve no purpose and don't belong in the public API. Signed-off-by: Paul Cercueil <pa...@cr...> commit 399d89a0b27d473033b62fab4784afd1aff63c51 Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 15:13:48 2025 +0200 timer: Remove timer_spin_sleep() Nobody needs to busy-wait for that long and it'd be a terrible idea anyway. Remove this function as it is not used anywhere anymore, and to prevent people from having the bad idea of using it. This frees up the TMU1 to be used by applications. Signed-off-by: Paul Cercueil <pa...@cr...> commit 0b5e4c8939f9bd58061bd04542060699a99bb3d6 Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 23:23:08 2025 +0200 sound: Use thd_sleep() instead of timer_spin_sleep() One millisecond is about 6% of the time we have to render a frame. As such, it does not make sense to busy-wait for such long times, especially when we can avoid it. Update the sound code to sleep instead of busy-waiting. Signed-off-by: Paul Cercueil <pa...@cr...> commit 9e77aa19ba54c31ffd336386c253494e879d7797 Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 23:22:35 2025 +0200 modem: Use thd_sleep() instead of timer_spin_sleep() One millisecond is about 6% of the time we have to render a frame. As such, it does not make sense to busy-wait for such long times, especially when we can avoid it. Update the modem code to sleep instead of busy-waiting. Signed-off-by: Paul Cercueil <pa...@cr...> commit c3779fa61906deb0255211f7913e62df69e121e8 Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 23:19:59 2025 +0200 g1ata: Use thd_sleep() instead of timer_spin_sleep() One millisecond is about 6% of the time we have to render a frame. As such, it does not make sense to busy-wait for such long times, especially when we can avoid it. Update the g1ata code to sleep instead of busy-waiting. Signed-off-by: Paul Cercueil <pa...@cr...> commit 40e8394ae4d1c0a38ffe608917b1de49b04a199e Author: Paul Cercueil <pa...@cr...> Date: Tue Aug 26 16:32:22 2025 +0200 thread: Make thd_sleep() fail if not using threading thd_sleep() (or any threading function for that matter) should not be called when the threading system is disabled. Also drop an extra <assert.h> include, we don't need two. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: include/kos/timer.h | 211 ++++++++++++++++++++++++ kernel/arch/dreamcast/hardware/cdrom.c | 2 +- kernel/arch/dreamcast/hardware/g1ata.c | 12 +- kernel/arch/dreamcast/hardware/maple/keyboard.c | 3 +- kernel/arch/dreamcast/hardware/maple/vmu.c | 2 +- kernel/arch/dreamcast/hardware/modem/modem.c | 10 +- kernel/arch/dreamcast/hardware/pvr/pvr_misc.c | 2 +- kernel/arch/dreamcast/hardware/sci.c | 2 +- kernel/arch/dreamcast/hardware/scif-spi.c | 2 +- kernel/arch/dreamcast/hardware/spu.c | 4 +- kernel/arch/dreamcast/include/arch/timer.h | 159 +++--------------- kernel/arch/dreamcast/kernel/init.c | 3 +- kernel/arch/dreamcast/kernel/initall_hdrs.h | 2 +- kernel/arch/dreamcast/kernel/irq.c | 2 +- kernel/arch/dreamcast/kernel/perf_monitor.c | 2 +- kernel/arch/dreamcast/kernel/perfctr.c | 2 +- kernel/arch/dreamcast/kernel/rtc.c | 2 +- kernel/arch/dreamcast/kernel/timer.c | 124 +------------- kernel/arch/dreamcast/sound/snd_iface.c | 4 +- kernel/arch/dreamcast/sound/snd_stream.c | 2 +- kernel/arch/dreamcast/util/screenshot.c | 2 +- kernel/exports.txt | 1 - kernel/libc/newlib/newlib_gettimeofday.c | 2 +- kernel/libc/newlib/newlib_times.c | 2 +- kernel/libc/posix/clock_gettime.c | 2 +- kernel/net/net_arp.c | 2 +- kernel/net/net_dhcp.c | 2 +- kernel/net/net_icmp.c | 2 +- kernel/net/net_icmp6.c | 2 +- kernel/net/net_ipv4.c | 2 +- kernel/net/net_ipv4_frag.c | 2 +- kernel/net/net_ndp.c | 2 +- kernel/net/net_tcp.c | 2 +- kernel/net/net_thd.c | 2 +- kernel/thread/genwait.c | 2 +- kernel/thread/mutex.c | 2 +- kernel/thread/thread.c | 10 +- 37 files changed, 292 insertions(+), 301 deletions(-) create mode 100644 include/kos/timer.h diff --git a/include/kos/timer.h b/include/kos/timer.h new file mode 100644 index 00000000..fba1db59 --- /dev/null +++ b/include/kos/timer.h @@ -0,0 +1,211 @@ +/* KallistiOS ##version## + + include/kos/timer.h + Copyright (C) 2025 Paul Cercueil +*/ + +/** \file kos/timer.h + \brief Timer functionality. + \ingroup timers + + This file contains functions for reading the internal timer provided + by the architecture. + + \sa arch/timer.h + + \author Paul Cercueil +*/ +#ifndef __KOS_TIMER_H +#define __KOS_TIMER_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <arch/timer.h> +#include <stdint.h> +#include <time.h> + +typedef struct timespec timespec_t; + +/** \brief Get the current uptime of the system. + \ingroup timers + + This function retrieves the number of seconds and nanoseconds since KOS was + started. + + \return The current uptime of the system as a timespec struct. +*/ +static inline timespec_t timer_gettime(void) { + return arch_timer_gettime(); +} + +/** \brief Get the current uptime of the system (in milliseconds). + \ingroup timers + + This function retrieves the number of milliseconds since KOS was started. It + is equivalent to calling timer_ms_gettime() and combining the number of + seconds and milliseconds into one 64-bit value. + + \return The number of milliseconds since KOS started. +*/ +static inline uint64_t timer_ms_gettime64(void) { + timespec_t time = timer_gettime(); + + return (uint64_t)time.tv_sec * 1000 + time.tv_nsec / 1000000; +} + +/** \brief Get the current uptime of the system (in microseconds). + \ingroup timers + + This function retrieves the number of microseconds since KOS was started. + + \return The uptime in microseconds. +*/ +static inline uint64_t timer_us_gettime64(void) { + timespec_t time = timer_gettime(); + + return (uint64_t)time.tv_sec * 1000000 + time.tv_nsec / 1000; +} + +/** \brief Get the current uptime of the system (in nanoseconds). + \ingroup timers + + This function retrieves the number of nanoseconds since KOS was started. + + \return The uptime in nanoseconds. +*/ +static inline uint64_t timer_ns_gettime64(void) { + timespec_t time = timer_gettime(); + + return (uint64_t)time.tv_sec * 1000000000 + time.tv_nsec; +} + +/** \brief Get the current uptime of the system (in secs and millisecs). + \ingroup timers + + This function retrieves the number of seconds and milliseconds since KOS was + started. + + \param secs A pointer to store the number of seconds since boot + into. + \param msecs A pointer to store the number of milliseconds past + a second since boot. + \note To get the total number of milliseconds since boot, + calculate (*secs * 1000) + *msecs, or use the + timer_ms_gettime64() function. +*/ +static inline void timer_ms_gettime(uint32_t *secs, uint32_t *msecs) { + timespec_t time = timer_gettime(); + + if(secs) *secs = time.tv_sec; + if(msecs) *msecs = time.tv_nsec / 1000000; +} + +/** \brief Get the current uptime of the system (in secs and microsecs). + \ingroup timers + + This function retrieves the number of seconds and microseconds since KOS was + started. + + \note To get the total number of microseconds since boot, + calculate (*secs * 1000000) + *usecs, or use the + timer_us_gettime64() function. + + \param secs A pointer to store the number of seconds since boot + into. + \param usecs A pointer to store the number of microseconds past + a second since boot. +*/ +static inline void timer_us_gettime(uint32_t *secs, uint32_t *usecs) { + timespec_t time = timer_gettime(); + + if(secs) *secs = time.tv_sec; + if(usecs) *usecs = time.tv_nsec / 1000; +} + +/** \brief Get the current uptime of the system (in secs and nanosecs). + \ingroup timers + + This function retrieves the number of seconds and nanoseconds since KOS was + started. + + \note To get the total number of nanoseconds since boot, + calculate (*secs * 1000000000) + *nsecs, or use the + timer_ns_gettime64() function. + + \param secs A pointer to store the number of seconds since boot + into. + \param nsecs A pointer to store the number of nanoseconds past + a second since boot. +*/ +static inline void timer_ns_gettime(uint32_t *secs, uint32_t *nsecs) { + timespec_t time = timer_gettime(); + + if(secs) *secs = time.tv_sec; + if(nsecs) *nsecs = time.tv_nsec; +} + +/** \brief Spin-loop delay function with microsecond granularity + \ingroup timers + + This function is meant as a very accurate delay function, even if threading + and interrupts are disabled. It is a delay and not a sleep, which means that + the CPU will be busy-looping during that time frame. For any time frame + bigger than a few hundred microseconds, it is recommended to sleep instead. + + Note that the parameter is 16-bit, which means that the maximum acceptable + value is 65535 microseconds. + + \param us The number of microseconds to wait for. + \sa timer_spin_delay_ns, thd_sleep +*/ +static inline void timer_spin_delay_us(unsigned short us) { + uint64_t timeout = timer_us_gettime64() + us; + + /* Note that we don't actually care about the counter overflowing. + Nobody will run their Dreamcast straight for 584942 years. */ + while(timer_us_gettime64() < timeout); +} + + +/** \brief Spin-loop delay function with nanosecond granularity + \ingroup timers + + This function is meant as a very accurate delay function, even if threading + and interrupts are disabled. It is a delay and not a sleep, which means that + the CPU will be busy-looping during that time frame. + + Note that the parameter is 16-bit, which means that the maximum acceptable + value is 65535 nanoseconds. + + \param ns The number of nanoseconds to wait for. + \sa timer_spin_delay_us, thd_sleep +*/ +static inline void timer_spin_delay_ns(unsigned short ns) { + uint64_t timeout = timer_ns_gettime64() + ns; + + /* Note that we don't actually care about the counter overflowing. + Nobody will run their Dreamcast straight for 585 years. */ + while(timer_ns_gettime64() < timeout); +} + +/** \brief Spin-loop delay function with millisecond granularity + \ingroup timers + + This function should never be used, and is only used for compatibility with + older code. It makes no sense to busy-wait for that long. + + \param ms The number of microseconds to wait for. + \sa thd_sleep +*/ + +__depr("Do not use timer_spin_sleep(), use thd_sleep() instead") +static inline void timer_spin_sleep(unsigned int ms) { + uint64_t timeout = timer_ms_gettime64() + ms; + + while(timer_ms_gettime64() < timeout); +} + +__END_DECLS + +#endif /* __KOS_TIMER_H */ diff --git a/kernel/arch/dreamcast/hardware/cdrom.c b/kernel/arch/dreamcast/hardware/cdrom.c index 7b0766a9..c4c21ed1 100644 --- a/kernel/arch/dreamcast/hardware/cdrom.c +++ b/kernel/arch/dreamcast/hardware/cdrom.c @@ -12,7 +12,7 @@ #include <assert.h> #include <arch/cache.h> -#include <arch/timer.h> +#include <kos/timer.h> #include <arch/memory.h> #include <arch/irq.h> diff --git a/kernel/arch/dreamcast/hardware/g1ata.c b/kernel/arch/dreamcast/hardware/g1ata.c index c447fee1..b6716b80 100644 --- a/kernel/arch/dreamcast/hardware/g1ata.c +++ b/kernel/arch/dreamcast/hardware/g1ata.c @@ -17,7 +17,7 @@ #include <kos/mutex.h> #include <kos/thread.h> -#include <arch/timer.h> +#include <kos/timer.h> #include <arch/cache.h> #include <arch/irq.h> #include <arch/memory.h> @@ -965,7 +965,7 @@ int g1_ata_flush(void) { /* Select the slave device. */ g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE); - timer_spin_sleep(1); + thd_sleep(1); /* Flush the disk's write cache to make sure everything gets written out. */ if(CAN_USE_LBA48()) @@ -973,7 +973,7 @@ int g1_ata_flush(void) { else OUT8(G1_ATA_COMMAND_REG, ATA_CMD_FLUSH_CACHE); - timer_spin_sleep(1); + thd_sleep(1); g1_ata_wait_bsydrq(); g1_ata_mutex_unlock(); @@ -1006,7 +1006,7 @@ static int g1_ata_set_transfer_mode(uint8_t mode) { /* Send the SET FEATURES command. */ OUT8(G1_ATA_COMMAND_REG, ATA_CMD_SET_FEATURES); - timer_spin_sleep(1); + thd_sleep(1); /* Wait for command completion. */ g1_ata_wait_nbsy(); @@ -1034,7 +1034,7 @@ static int g1_ata_scan(void) { /* For now, just check if there's a slave device. We don't care about the primary device, since it should always be the GD-ROM drive. */ OUT8(G1_ATA_DEVICE_SELECT, 0xF0); - timer_spin_sleep(1); + thd_sleep(1); OUT8(G1_ATA_SECTOR_COUNT, 0); OUT8(G1_ATA_LBA_LOW, 0); @@ -1043,7 +1043,7 @@ static int g1_ata_scan(void) { /* Send the IDENTIFY command. */ OUT8(G1_ATA_COMMAND_REG, ATA_CMD_IDENTIFY); - timer_spin_sleep(1); + thd_sleep(1); st = IN8(G1_ATA_STATUS_REG); /* Check if there's anything on the bus. */ diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index 8599f774..4ecfe5c5 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -15,7 +15,8 @@ #include <kos/dbglog.h> -#include <arch/timer.h> +#include <kos/timer.h> +#include <arch/irq.h> #include <dc/maple.h> #include <dc/maple/keyboard.h> diff --git a/kernel/arch/dreamcast/hardware/maple/vmu.c b/kernel/arch/dreamcast/hardware/maple/vmu.c index 922f1754..86fa12eb 100644 --- a/kernel/arch/dreamcast/hardware/maple/vmu.c +++ b/kernel/arch/dreamcast/hardware/maple/vmu.c @@ -25,7 +25,7 @@ #include <dc/math.h> #include <dc/biosfont.h> #include <dc/vmufs.h> -#include <arch/timer.h> +#include <kos/timer.h> #define VMU_BLOCK_WRITE_RETRY_TIME 100 /* time to sleep until retrying a failed write */ diff --git a/kernel/arch/dreamcast/hardware/modem/modem.c b/kernel/arch/dreamcast/hardware/modem/modem.c index 940a02b2..f71146d6 100644 --- a/kernel/arch/dreamcast/hardware/modem/modem.c +++ b/kernel/arch/dreamcast/hardware/modem/modem.c @@ -448,14 +448,14 @@ void modemHardReset(void) { /* This zeroes out all of the modem's registers */ modemWrite(G2_8BP_RST, 0); - timer_spin_sleep(25); /* A slight delay just to be safe */ + thd_sleep(25); /* A slight delay just to be safe */ /* This sets the modem's registers to their default settings */ modemWrite(G2_8BP_RST, 1); /* Wait for a little while so the modem has time to reset itself completely */ - timer_spin_sleep(150); + thd_sleep(150); } void modemSoftReset(void) { @@ -465,7 +465,7 @@ void modemSoftReset(void) { while(modemRead(REGLOC(0x1F)) & 0x1); /* Wait for NEWC to clear */ /* Wait a minimum of 10ms before using the MDP again */ - timer_spin_sleep(100); + thd_sleep(100); } void modemConfigurationReset(void) { @@ -600,7 +600,7 @@ int modem_set_mode(int mode, modem_speed_t speed) { modemSetBits(REGLOC(0x1F), 0x1); /* Set NEWC */ /* Delay at least 4ms */ - timer_spin_sleep(10); + thd_sleep(10); /* Dial using DTMF tones, and set the modem in origination mode */ @@ -801,7 +801,7 @@ void modemEstablishConnection(void) { can be answered */ if(!(modemCfg.flags & MODEM_CFG_FLAG_ORIGINATE)) { modemSetBits(REGLOC(0x7), 0x2); /* Set RA */ - timer_spin_sleep(10); + thd_sleep(10); } /* Note that in all modes of operation RTS will be turned on as soon diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c index 8e814195..e9ebf611 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c @@ -10,7 +10,7 @@ #include <string.h> #include <float.h> -#include <arch/timer.h> +#include <kos/timer.h> #include <dc/pvr.h> #include <dc/video.h> #include <kos/regfield.h> diff --git a/kernel/arch/dreamcast/hardware/sci.c b/kernel/arch/dreamcast/hardware/sci.c index 82322412..8b839880 100644 --- a/kernel/arch/dreamcast/hardware/sci.c +++ b/kernel/arch/dreamcast/hardware/sci.c @@ -8,7 +8,7 @@ #include <dc/math.h> #include <arch/cache.h> #include <arch/dmac.h> -#include <arch/timer.h> +#include <kos/timer.h> #include <kos/dbglog.h> #include <kos/regfield.h> diff --git a/kernel/arch/dreamcast/hardware/scif-spi.c b/kernel/arch/dreamcast/hardware/scif-spi.c index 0485a9e5..171e3ea1 100644 --- a/kernel/arch/dreamcast/hardware/scif-spi.c +++ b/kernel/arch/dreamcast/hardware/scif-spi.c @@ -8,7 +8,7 @@ #include <dc/scif.h> #include <dc/fs_dcload.h> -#include <arch/timer.h> +#include <kos/timer.h> #include <kos/dbglog.h> #include <kos/regfield.h> diff --git a/kernel/arch/dreamcast/hardware/spu.c b/kernel/arch/dreamcast/hardware/spu.c index 21136e39..78de2315 100644 --- a/kernel/arch/dreamcast/hardware/spu.c +++ b/kernel/arch/dreamcast/hardware/spu.c @@ -9,7 +9,7 @@ #include <dc/spu.h> #include <dc/g2bus.h> #include <dc/sq.h> -#include <arch/timer.h> +#include <kos/timer.h> #include <errno.h> /* @@ -355,7 +355,7 @@ int spu_init(void) { spu_enable(); /* Wait a few clocks */ - timer_spin_sleep(10); + thd_sleep(10); /* Initialize CDDA channels */ spu_cdda_init(); diff --git a/kernel/arch/dreamcast/include/arch/timer.h b/kernel/arch/dreamcast/include/arch/timer.h index caf1290c..99694a32 100644 --- a/kernel/arch/dreamcast/include/arch/timer.h +++ b/kernel/arch/dreamcast/include/arch/timer.h @@ -34,6 +34,8 @@ __BEGIN_DECLS #include <arch/irq.h> +#include <time.h> + /** \defgroup timers Timer Unit \brief SH4 CPU peripheral providing timers and counters \ingroup timing @@ -82,8 +84,7 @@ __BEGIN_DECLS /** \brief SH4 Timer Channel 1. \warning - This timer channel is used for the timer_spin_sleep() function, which also - backs the kthread, C, C++, and POSIX sleep functions. + This timer channel is free to use. */ #define TMU1 1 @@ -231,148 +232,39 @@ int timer_ints_enabled(int channel); The highest actual tick resolution of \ref TMU2 is 80ns. */ -/** \brief Enable the millisecond timer. - \ingroup tmu_uptime - - This function enables the timer used for the gettime functions. This is on - by default. These functions use \ref TMU2 to do their work. -*/ -void timer_ms_enable(void); - -/** \brief Disable the millisecond timer. - \ingroup tmu_uptime - - This function disables the timer used for the gettime functions. Generally, - you will not want to do this, unless you have some need to use the timer - \ref TMU2 for something else. -*/ -void timer_ms_disable(void); - -/** \brief Get the current uptime of the system (in secs and millisecs). - \ingroup tmu_uptime - - This function retrieves the number of seconds and milliseconds since KOS was ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |