From: ljsebald <ljs...@us...> - 2023-12-23 04:20:54
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via c6bd4112b76ef25edb63bde4352dc89e7f41a805 (commit) via 1ba7a22d7623218d10c68bceecbad3c70aa80682 (commit) via 60b135a8a220a5be9de903093d31e4e486917ab1 (commit) via af7b6787c133ee37c5325bb342dae4825204a078 (commit) via 739ed6debee1e13b69f9c95616fa97209a46bc1e (commit) via 3b1dc582c5ad2db8949edbf049eda788ba5e5408 (commit) via a749689b51e7c078a7e32b1953f6a50f24e821f7 (commit) from b316401ae52b611dc9a646da5781019cb45ef33a (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 c6bd4112b76ef25edb63bde4352dc89e7f41a805 Merge: 1ba7a22 af7b678 Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 22 23:20:19 2023 -0500 Merge pull request #429 from KallistiOS/800x600_notice Added Disclaimer to 800x608 Resolution Example commit 1ba7a22d7623218d10c68bceecbad3c70aa80682 Merge: 60b135a 3b1dc58 Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 22 23:19:37 2023 -0500 Merge pull request #423 from KallistiOS/clock_CLOCKS_PER_SEC_upgrade Increased Resolution of C's clock() to Microseconds commit 60b135a8a220a5be9de903093d31e4e486917ab1 Merge: b316401 739ed6d Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 22 23:18:31 2023 -0500 Merge pull request #428 from KallistiOS/bba_doxygen_topics Added and Improved BBA Doxygen Documentation commit af7b6787c133ee37c5325bb342dae4825204a078 Author: Falco Girgis <gyr...@gm...> Date: Wed Dec 20 23:30:45 2023 -0600 Added disclaimer to 800x608 resolution example - Because users, including our own developers, are continually being confused by the garbled output. :) commit 739ed6debee1e13b69f9c95616fa97209a46bc1e Author: Falco Girgis <gyr...@gm...> Date: Wed Dec 20 23:12:12 2023 -0600 Added and improved BBA doxygen documentation - I went back through and noticed somehow the BBA was the only set of doxygen topics in the whole codebase still missing \brief info, added. - Reorganized topics for improved discoverablity and grouping commit 3b1dc582c5ad2db8949edbf049eda788ba5e5408 Author: Falco Girgis <gyr...@gm...> Date: Wed Dec 20 16:03:34 2023 -0600 Update doc/CHANGELOG Co-authored-by: Lawrence Sebald <ljs...@us...> commit a749689b51e7c078a7e32b1953f6a50f24e821f7 Author: Falco Girgis <gyr...@gm...> Date: Tue Dec 19 17:11:59 2023 -0600 Increased clock() and CLOCKS_PER_SEC to microsecs - Added #define to kos/time.h to provide newlib with an initial value for CLOCKS_PER_SEC - Modified newlib_times.c to use the microsecond timer, which is what backs the clock() C stdlib function - Updated CHANGELOG ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + examples/dreamcast/libdream/800x608/800x608.c | 3 + include/kos/time.h | 1 + .../dreamcast/include/dc/net/broadband_adapter.h | 76 ++++++++++++++-------- kernel/libc/newlib/newlib_times.c | 9 +-- 5 files changed, 60 insertions(+), 30 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d0d59b3..5f6f731 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -212,6 +212,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Added basic example for micropython KOS port [Aaron Glazer == AG] - DC Improved performance of IRQ context save / restore [PC] - DC Increased resolution of TMU timers + date/time functions [FG && PC] +- *** Increased resolution of clock() and CLOCKS_PER_SEC to microseconds [FG] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/examples/dreamcast/libdream/800x608/800x608.c b/examples/dreamcast/libdream/800x608/800x608.c index 40fc6ea..15da9b1 100644 --- a/examples/dreamcast/libdream/800x608/800x608.c +++ b/examples/dreamcast/libdream/800x608/800x608.c @@ -22,6 +22,9 @@ int main(int argc, char **argv) { cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y, (cont_btn_callback_t)arch_exit); + printf("\n\n*** NOTE: This example is still a work in progress\n"); + printf(" as this resolution is not fully supported! ***\n\n"); + /* Set video mode */ vid_set_mode(DM_800x608, PM_RGB565); diff --git a/include/kos/time.h b/include/kos/time.h index 18236ea..5ebc30a 100644 --- a/include/kos/time.h +++ b/include/kos/time.h @@ -34,6 +34,7 @@ __BEGIN_DECLS struct timespec; #define TIME_UTC 1 +#define CLOCKS_PER_SEC 1000000 extern int timespec_get(struct timespec *ts, int base); diff --git a/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h b/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h index 5fdf63c..d271022 100644 --- a/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h +++ b/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h @@ -23,12 +23,18 @@ __BEGIN_DECLS /** \defgroup bba Broadband Adapter - \brief Driver for the Dreamcast's BBA (RTL8139C). - \ingroup networking_drivers + \brief Driver for the Dreamcast's BBA (RTL8139C). + \ingroup networking_drivers + @{ +*/ + +/** \defgroup bba_regs Registers + \brief Registers and related info for the broadband adapter + @{ */ -/** \defgroup bba_regs Register Definitions - \ingroup bba +/** \defgroup bba_regs_locs Locations + \brief Locations for various broadband adapter registers. The default assumption is that these are all RW at any aligned size unless otherwise noted. ex (RW 32bit, RO 16/8) indicates read/write at 32bit and @@ -94,9 +100,13 @@ __BEGIN_DECLS #define RT_CONFIG5 0xD8 /**< \brief Config register 5 */ /** @} */ +/** \defgroup bba_regs_fields Fields + \brief Register fields for the broadband adapter + @{ +*/ + /** \defgroup bba_miicb MII Control Bits - \brief Control bits for the Media Independent Interface of the BBA - \ingroup bba + \brief BBA media independent interface control register fields @{ */ #define RT_MII_RESET 0x8000 /**< \brief Reset the MII chip */ @@ -107,12 +117,10 @@ __BEGIN_DECLS #define RT_MII_RES0400 0x0400 /**< \brief Reserved */ #define RT_MII_AN_START 0x0200 /**< \brief Start auto-negotiation */ #define RT_MII_DUPLEX 0x0100 /**< \brief 1 for full 0 for half. Ignored if AN enabled. */ - /** @} */ /** \defgroup bba_miisb MII Status Bits - \brief Status bits for the Media Independent Interface of the BBA - \ingroup bba + \brief BBA media independent interface status register fields @{ */ #define RT_MII_LINK 0x0004 /**< \brief Link is present */ @@ -125,7 +133,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_cbits Command Bits - \ingroup bba + \brief BBA command register fields OR appropriate bit values together and write into the RT_CHIPCMD register to execute the command. @@ -139,7 +147,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_ibits Interrupt Status Bits - \ingroup bba + \brief BBA interrupt status fields @{ */ #define RT_INT_PCIERR 0x8000 /**< \brief PCI Bus error */ @@ -153,14 +161,12 @@ __BEGIN_DECLS #define RT_INT_RX_ERR 0x0002 /**< \brief Rx error */ #define RT_INT_RX_OK 0x0001 /**< \brief Rx OK */ -/** \brief Composite RX bits we check for while doing an RX interrupt. - \ingroup bba - */ +/** \brief Composite RX bits we check for while doing an RX interrupt. */ #define RT_INT_RX_ACK (RT_INT_RXFIFO_OVERFLOW | RT_INT_RXBUF_OVERFLOW | RT_INT_RX_OK) /** @} */ /** \defgroup bba_tbits Transmit Status Bits - \ingroup bba + \brief BBA transmit status register fields @{ */ #define RT_TX_CARRIER_LOST 0x80000000 /**< \brief Carrier sense lost */ @@ -173,7 +179,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_rbits Receive Status Bits - \ingroup bba + \brief BBA receive status register fields @{ */ #define RT_RX_MULTICAST 0x00008000 /**< \brief Multicast packet */ @@ -188,7 +194,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_config1bits Config Register 1 Bits - \ingroup bba + \brief BBA config register 1 fields From RTL8139C(L) datasheet v1.4 @@ -205,7 +211,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_config4bits Config Register 4 Bits - \ingroup bba + \brief BBA config register 4 fields From RTL8139C(L) datasheet v1.4. Only RT_CONFIG4_RxFIFIOAC is used. @@ -222,7 +228,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_config5bits Config Register 5 Bits - \ingroup bba + \brief BBA config register 5 fields From RTL8139C(L) datasheet v1.4. Only RT_CONFIG5_LDPS is used. @@ -238,8 +244,11 @@ __BEGIN_DECLS #define RT_CONFIG5_PME_STS 0x01 /**< \brief Allow PCI reset to set PME_Status bit. */ /** @} */ +/** @} */ + +/** @} */ + /** \brief Retrieve the MAC Address of the attached BBA. - \ingroup bba This function reads the MAC Address of the BBA and places it in the buffer passed in. The resulting data is undefined if no BBA is connected. @@ -248,8 +257,12 @@ __BEGIN_DECLS */ void bba_get_mac(uint8 *arr); +/** \defgroup bba_rx RX + \brief Receive packet API for the BBA + @{ +*/ + /** \brief Receive packet callback function type. - \ingroup bba When a packet is received by the BBA, the callback function will be called to handle it. @@ -260,7 +273,6 @@ void bba_get_mac(uint8 *arr); typedef void (*eth_rx_callback_t)(uint8 *pkt, int len); /** \brief Set the ethernet packet receive callback. - \ingroup bba This function sets the function called when a packet is received by the BBA. Generally, this inputs into the network layer. @@ -269,8 +281,15 @@ typedef void (*eth_rx_callback_t)(uint8 *pkt, int len); */ void bba_set_rx_callback(eth_rx_callback_t cb); -/** \defgroup bba_txrv bba_tx() Return Values - \ingroup bba +/** @} */ + +/** \defgroup bba_tx TX + \brief Transmit packet API for the BBA + @{ +*/ + +/** \defgroup bba_txrv Return Values + \brief Return values for bba_tx() @{ */ #define BBA_TX_OK 0 /**< \brief Transmit success */ @@ -279,13 +298,14 @@ void bba_set_rx_callback(eth_rx_callback_t cb); /** @} */ /** \defgroup bba_wait Wait Modes - \ingroup bba + \brief Wait modes for bba_tx() + @{ */ #define BBA_TX_NOWAIT 0 /**< \brief Don't block waiting for the transfer. */ #define BBA_TX_WAIT 1 /**< \brief Wait, if needed on transfer. */ +/** @} */ /** \brief Transmit a single packet. - \ingroup bba This function transmits a single packet on the bba, waiting for the link to become stable, if requested. @@ -302,6 +322,8 @@ void bba_set_rx_callback(eth_rx_callback_t cb); */ int bba_tx(const uint8 *pkt, int len, int wait); +/** @} */ + /* \cond */ /* Initialize */ int bba_init(void); @@ -310,6 +332,8 @@ int bba_init(void); int bba_shutdown(void); /* \endcond */ +/** @} */ + __END_DECLS #endif /* __DC_NET_BROADBAND_ADAPTER_H */ diff --git a/kernel/libc/newlib/newlib_times.c b/kernel/libc/newlib/newlib_times.c index eb84536..fd56d1c 100644 --- a/kernel/libc/newlib/newlib_times.c +++ b/kernel/libc/newlib/newlib_times.c @@ -3,6 +3,7 @@ newlib_times.c Copyright (C) 2004 Megan Potter Copyright (C) 2022 Lawrence Sebald + Copyright (C) 2023 Falco Girgis */ @@ -11,13 +12,13 @@ #include <sys/times.h> #include <arch/timer.h> -int _times_r(struct _reent * re, struct tms * tmsbuf) { +int _times_r(struct _reent *re, struct tms *tmsbuf) { (void)re; if(tmsbuf) { - /* Conveniently, CLOCKS_PER_SEC is 1000, so we can just use the - millisecond timer. */ - tmsbuf->tms_utime = (clock_t)timer_ms_gettime64(); + /* Conveniently, CLOCKS_PER_SEC is 1000000, so we can just use the + microsecond timer. */ + tmsbuf->tms_utime = (clock_t)timer_us_gettime64(); tmsbuf->tms_stime = 0; tmsbuf->tms_cutime = 0; tmsbuf->tms_cstime = 0; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |