From: quzar <qu...@us...> - 2025-01-10 05:23:52
|
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 4120477f4344f89a5bcc121ced62ff751901db17 (commit) via b7b0cac5a9bfbcddee99a9bd2d5ec5efc69c8947 (commit) via 98b9dac2f4e93cae4f9c710385e5ce380f59c51d (commit) via ce51da725e8bfada9081e7d2920361a698d2541e (commit) via c7ec613196b80908f0f1eb1065c8df89099f1ddd (commit) via 134228724529e561420ed88477abc0c1676de03b (commit) via 6cc0c509120bbd4686f6bdec5c0df857dadb976e (commit) via 26f49ee127ee0d92dd0874285878f14b6291f7f2 (commit) via c0405501a9f139b70bf15e074fd3d6c5eed77984 (commit) via 449ab7d2befe23478115fde1a6568d6cbf8ea9d2 (commit) via 24f61291155e8c8204631ef5a77f19f8e77051f9 (commit) via 32ca2c2c0c8bf02051ccdc15d407cc92a9556d1a (commit) via 5999ca2ef73dae22ca518e5143385aac6432d910 (commit) via e554125ecb3c8220e0cdc29a56db4aa68e90afca (commit) via 4b11c9e60120ccd6cb1dbbcf17a9631d9a58e8fe (commit) via 421454fd77147251d19e5038095791b931ea97c7 (commit) via d7ebcc825b30a0df2dd2b0bc11c503275e54509d (commit) from 515eaeef6a3823b17d50c037fd74099e055dcb81 (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 4120477f4344f89a5bcc121ced62ff751901db17 Merge: b7b0cac5 c7ec6131 Author: Donald Haase <qu...@ya...> Date: Fri Jan 10 00:07:55 2025 -0500 Merge pull request #884 from pcercuei/shrink-irq irq: Shrink IRQ table size commit b7b0cac5a9bfbcddee99a9bd2d5ec5efc69c8947 Merge: 98b9dac2 13422872 Author: Donald Haase <qu...@ya...> Date: Fri Jan 10 00:03:39 2025 -0500 Merge pull request #876 from pcercuei/spinlock-cleanup Spinlock cleanups commit 98b9dac2f4e93cae4f9c710385e5ce380f59c51d Merge: 515eaeef ce51da72 Author: Donald Haase <qu...@ya...> Date: Fri Jan 10 00:02:15 2025 -0500 Merge pull request #888 from pcercuei/asm-not-asm arch.h: Use __asm__ instead of asm commit ce51da725e8bfada9081e7d2920361a698d2541e Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 9 12:58:56 2025 +0100 arch.h: Use __asm__ instead of asm Using just "asm" seems to cause compilation errors when building some external software that use ISO compliant C and not the GNU version. Signed-off-by: Paul Cercueil <pa...@cr...> commit c7ec613196b80908f0f1eb1065c8df89099f1ddd Author: Paul Cercueil <pa...@cr...> Date: Tue Jan 7 16:13:51 2025 +0100 irq: Shrink IRQ table size All exception codes were divisible by 32, except for the two soft exceptions. Since they do not represent any hardware value, modify these code so that they are also divisible by 32, and make them smaller than 0x800. This means that all exception codes can now be represented in just 6 bits, and the IRQ table can be reduced from 0x100 entries to just 0x40 entries. This saves 1.5 KiB, but more importantly, the table now fits in just 16 cache lines instead of 64 cache lines. Signed-off-by: Paul Cercueil <pa...@cr...> commit 134228724529e561420ed88477abc0c1676de03b Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 15:12:03 2025 +0100 atomics: Use spinlock_lock_scoped() Use spinlock_lock_scoped() to simplify code. Signed-off-by: Paul Cercueil <pa...@cr...> commit 6cc0c509120bbd4686f6bdec5c0df857dadb976e Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 15:10:13 2025 +0100 atomics: Use irq_disable_scoped() Use irq_disable_scoped() to simplify code. Signed-off-by: Paul Cercueil <pa...@cr...> commit 26f49ee127ee0d92dd0874285878f14b6291f7f2 Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 15:05:35 2025 +0100 atomics: Whitespace fixes Remove stray spaces that were polluting atomics.c. Signed-off-by: Paul Cercueil <pa...@cr...> commit c0405501a9f139b70bf15e074fd3d6c5eed77984 Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 15:02:52 2025 +0100 malloc_debug: Use spinlock_lock_scoped() Use spinlock_lock_scoped() to simplify code. Note that after this change, the mutex is unlocked after the debug message in malloc(). This should be fine, as free() was already calling printf() several times with the spinlock held. Signed-off-by: Paul Cercueil <pa...@cr...> commit 449ab7d2befe23478115fde1a6568d6cbf8ea9d2 Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 15:02:25 2025 +0100 tls: Use spinlock_lock_scoped() Use spinlock_lock_scoped() to simplify code. Signed-off-by: Paul Cercueil <pa...@cr...> commit 24f61291155e8c8204631ef5a77f19f8e77051f9 Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 15:01:14 2025 +0100 snd_mem: Use spinlock_lock_irqsafe() Use spinlock_lock_irqsafe() to simplify code. Note that snd_mem_shutdown() and snd_mem_free() now won't set an errno on error. This is because those functions do not return any error code, so it makes no sense to set errno either. Signed-off-by: Paul Cercueil <pa...@cr...> commit 32ca2c2c0c8bf02051ccdc15d407cc92a9556d1a Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 14:59:08 2025 +0100 fs_dcload: Use spinlock_lock_scoped() Use spinlock_lock_scoped() to simplify code. Signed-off-by: Paul Cercueil <pa...@cr...> commit 5999ca2ef73dae22ca518e5143385aac6432d910 Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 14:57:41 2025 +0100 fs_dcload: Use irq_disable_scoped() Use irq_disable_scoped() inside the plain_dclsc() macro. Note that the behaviour is slightly different as we do not check whether or not we are running in an interrupt context. This was changed because it actually makes zero difference. Signed-off-by: Paul Cercueil <pa...@cr...> commit e554125ecb3c8220e0cdc29a56db4aa68e90afca Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 14:49:31 2025 +0100 spinlock: Add spinlock_lock_irqsafe() This function behaves like spinlock_lock(), except that it will not spin if the lock cannot be obtained when running within an interrupt context. Signed-off-by: Paul Cercueil <pa...@cr...> commit 4b11c9e60120ccd6cb1dbbcf17a9631d9a58e8fe Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 14:32:02 2025 +0100 spinlock: Add spinlock_lock_scoped() Similar to irq_disable_scoped() or mutex_lock_scoped(), the new spinlock_lock_scoped() macro Signed-off-by: Paul Cercueil <pa...@cr...> commit 421454fd77147251d19e5038095791b931ea97c7 Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 14:20:38 2025 +0100 spinlock: Update inline ASM Instead of specifying that the inline ASM modifies memory without more information, tell it that the memory pointed by the spinlock pointer will be modified. The compiler then knows that it does not have to reload all the variables from memory after a call to spinlock_trylock() or spinlock_lock(). Signed-off-by: Paul Cercueil <pa...@cr...> commit d7ebcc825b30a0df2dd2b0bc11c503275e54509d Author: Paul Cercueil <pa...@cr...> Date: Thu Jan 2 14:13:21 2025 +0100 spinlock: Transform macros into inline functions There is no valid reason to have the spinlock API as macros. Convert it to static inline functions to benefit from type checking. Note that spinlock_trylock() was moved up in the file so that it can be used within spinlock_lock() to factorize code. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/fs/fs_dcload.c | 64 ++++--------- kernel/arch/dreamcast/include/arch/arch.h | 2 +- kernel/arch/dreamcast/include/arch/irq.h | 4 +- kernel/arch/dreamcast/include/arch/spinlock.h | 126 ++++++++++++++++---------- kernel/arch/dreamcast/kernel/irq.c | 12 +-- kernel/arch/dreamcast/sound/snd_mem.c | 55 +++-------- kernel/libc/c11/atomics.c | 93 +++++++------------ kernel/mm/malloc_debug.c | 7 +- kernel/thread/tls.c | 19 ++-- 9 files changed, 164 insertions(+), 218 deletions(-) diff --git a/kernel/arch/dreamcast/fs/fs_dcload.c b/kernel/arch/dreamcast/fs/fs_dcload.c index 949952ab..c40e21f3 100644 --- a/kernel/arch/dreamcast/fs/fs_dcload.c +++ b/kernel/arch/dreamcast/fs/fs_dcload.c @@ -35,16 +35,10 @@ printf goes to the dc-tool console static spinlock_t mutex = SPINLOCK_INITIALIZER; #define plain_dclsc(...) ({ \ - int old = 0, rv; \ - if(!irq_inside_int()) { \ - old = irq_disable(); \ - } \ + irq_disable_scoped(); \ while(FIFO_STATUS & FIFO_SH4) \ ; \ - rv = dcloadsyscall(__VA_ARGS__); \ - if(!irq_inside_int()) \ - irq_restore(old); \ - rv; \ + dcloadsyscall(__VA_ARGS__); \ }) // #define plain_dclsc(...) dcloadsyscall(__VA_ARGS__) @@ -70,9 +64,8 @@ int dcload_write_buffer(const uint8 *data, int len, int xlat) { return -1; } - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); dclsc(DCLOAD_WRITE, 1, data, len); - spinlock_unlock(&mutex); return len; } @@ -82,25 +75,19 @@ int dcload_read_cons(void) { } size_t dcload_gdbpacket(const char* in_buf, size_t in_size, char* out_buf, size_t out_size) { - size_t ret = -1; - if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); /* we have to pack the sizes together because the dcloadsyscall handler can only take 4 parameters */ - ret = dclsc(DCLOAD_GDBPACKET, in_buf, (in_size << 16) | (out_size & 0xffff), out_buf); - - spinlock_unlock(&mutex); - return ret; + return dclsc(DCLOAD_GDBPACKET, in_buf, (in_size << 16) | (out_size & 0xffff), out_buf); } static char *dcload_path = NULL; void *dcload_open(vfs_handler_t * vfs, const char *fn, int mode) { int hnd = 0; - uint32 h; int dcload_mode = 0; int mm = (mode & O_MODE_MASK); @@ -109,7 +96,7 @@ void *dcload_open(vfs_handler_t * vfs, const char *fn, int mode) { if(lwip_dclsc && irq_inside_int()) return (void *)0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); if(mode & O_DIR) { if(fn[0] == '\0') { @@ -151,11 +138,7 @@ void *dcload_open(vfs_handler_t * vfs, const char *fn, int mode) { hnd++; /* KOS uses 0 for error, not -1 */ } - h = hnd; - - spinlock_unlock(&mutex); - - return (void *)h; + return (void *)hnd; } int dcload_close(void * h) { @@ -166,7 +149,7 @@ int dcload_close(void * h) { return -1; } - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); if(hnd) { if(hnd > 100) /* hack */ @@ -177,7 +160,6 @@ int dcload_close(void * h) { } } - spinlock_unlock(&mutex); return 0; } @@ -188,14 +170,13 @@ ssize_t dcload_read(void * h, void *buf, size_t cnt) { if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); if(hnd) { hnd--; /* KOS uses 0 for error, not -1 */ ret = dclsc(DCLOAD_READ, hnd, buf, cnt); } - spinlock_unlock(&mutex); return ret; } @@ -206,14 +187,13 @@ ssize_t dcload_write(void * h, const void *buf, size_t cnt) { if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); if(hnd) { hnd--; /* KOS uses 0 for error, not -1 */ ret = dclsc(DCLOAD_WRITE, hnd, buf, cnt); } - spinlock_unlock(&mutex); return ret; } @@ -224,14 +204,13 @@ off_t dcload_seek(void * h, off_t offset, int whence) { if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); if(hnd) { hnd--; /* KOS uses 0 for error, not -1 */ ret = dclsc(DCLOAD_LSEEK, hnd, offset, whence); } - spinlock_unlock(&mutex); return ret; } @@ -242,14 +221,13 @@ off_t dcload_tell(void * h) { if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); if(hnd) { hnd--; /* KOS uses 0 for error, not -1 */ ret = dclsc(DCLOAD_LSEEK, hnd, 0, SEEK_CUR); } - spinlock_unlock(&mutex); return ret; } @@ -261,7 +239,7 @@ size_t dcload_total(void * h) { if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); if(hnd) { hnd--; /* KOS uses 0 for error, not -1 */ @@ -270,7 +248,6 @@ size_t dcload_total(void * h) { dclsc(DCLOAD_LSEEK, hnd, cur, SEEK_SET); } - spinlock_unlock(&mutex); return ret; } @@ -293,7 +270,7 @@ dirent_t *dcload_readdir(void * h) { return NULL; } - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); dcld = (dcload_dirent_t *)dclsc(DCLOAD_READDIR, hnd); @@ -323,7 +300,6 @@ dirent_t *dcload_readdir(void * h) { free(fn); } - spinlock_unlock(&mutex); return rv; } @@ -335,7 +311,7 @@ int dcload_rename(vfs_handler_t * vfs, const char *fn1, const char *fn2) { if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); + spinlock_lock_scoped(&mutex); /* really stupid hack, since I didn't put rename() in dcload */ @@ -344,24 +320,18 @@ int dcload_rename(vfs_handler_t * vfs, const char *fn1, const char *fn2) { if(!ret) ret = dclsc(DCLOAD_UNLINK, fn1); - spinlock_unlock(&mutex); return ret; } int dcload_unlink(vfs_handler_t * vfs, const char *fn) { - int ret; - (void)vfs; if(lwip_dclsc && irq_inside_int()) return 0; - spinlock_lock(&mutex); - - ret = dclsc(DCLOAD_UNLINK, fn); + spinlock_lock_scoped(&mutex); - spinlock_unlock(&mutex); - return ret; + return dclsc(DCLOAD_UNLINK, fn); } static int dcload_stat(vfs_handler_t *vfs, const char *path, struct stat *st, diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h index 3bdc06c3..b26d9ea3 100644 --- a/kernel/arch/dreamcast/include/arch/arch.h +++ b/kernel/arch/dreamcast/include/arch/arch.h @@ -387,7 +387,7 @@ static inline uintptr_t arch_get_ret_addr(void) { \note This only works if you don't disable frame pointers. */ static inline uintptr_t arch_get_fptr(void) { - register uintptr_t fp asm("r14"); + register uintptr_t fp __asm__("r14"); return fp; } diff --git a/kernel/arch/dreamcast/include/arch/irq.h b/kernel/arch/dreamcast/include/arch/irq.h index 54c46889..7770a429 100644 --- a/kernel/arch/dreamcast/include/arch/irq.h +++ b/kernel/arch/dreamcast/include/arch/irq.h @@ -251,8 +251,8 @@ typedef enum irq_exception { EXC_SCIF_RXI = 0x0720, /**< `[POST ]` SCIF Receive ready */ EXC_SCIF_BRI = 0x0740, /**< `[POST ]` SCIF break */ EXC_SCIF_TXI = 0x0760, /**< `[POST ]` SCIF Transmit ready */ - EXC_DOUBLE_FAULT = 0x0ff0, /**< `[SOFT ]` Exception happened in an ISR */ - EXC_UNHANDLED_EXC = 0x0fe0 /**< `[SOFT ]` Exception went unhandled */ + EXC_DOUBLE_FAULT = 0x0780, /**< `[SOFT ]` Exception happened in an ISR */ + EXC_UNHANDLED_EXC = 0x07e0 /**< `[SOFT ]` Exception went unhandled */ } irq_t; diff --git a/kernel/arch/dreamcast/include/arch/spinlock.h b/kernel/arch/dreamcast/include/arch/spinlock.h index edebdef0..f7a45121 100644 --- a/kernel/arch/dreamcast/include/arch/spinlock.h +++ b/kernel/arch/dreamcast/include/arch/spinlock.h @@ -30,6 +30,8 @@ #include <sys/cdefs.h> __BEGIN_DECLS +#include <stdbool.h> + /* DC implementation uses threads most of the time */ #include <kos/thread.h> @@ -45,80 +47,112 @@ typedef volatile int spinlock_t; /** \brief Initialize a spinlock. - This function-like macro abstracts initializing a spinlock, in case the + This function abstracts initializing a spinlock, in case the initializer is not applicable to what you are doing. - \param A A pointer to the spinlock to be initialized. + \param lock A pointer to the spinlock to be initialized. */ -#define spinlock_init(A) *(A) = SPINLOCK_INITIALIZER +static inline void spinlock_init(spinlock_t *lock) { + *lock = SPINLOCK_INITIALIZER; +} /* Note here that even if threads aren't enabled, we'll still set the lock so that it can be used for anti-IRQ protection (e.g., malloc) */ +/** \brief Try to lock, without spinning. + + This function will attempt to lock the lock, but will not spin. Instead, it + will return whether the lock was obtained or not. + + \param lock A pointer to the spinlock to be locked. + \return False if the lock is held by another thread. True if + the lock was successfully obtained. +*/ +static inline bool spinlock_trylock(spinlock_t *lock) { + bool locked = false; + + __asm__ __volatile__("tas.b @%2\n\t" + "movt %0\n\t" + : "=r"(locked), "=m"(*lock) + : "r"(lock) + : "t"); + + return locked; +} + /** \brief Spin on a lock. - This macro will spin on the lock, and will not return until the lock has + This function will spin on the lock, and will not return until the lock has been obtained for the calling thread. - \param A A pointer to the spinlock to be locked. + \param lock A pointer to the spinlock to be locked. */ -#define spinlock_lock(A) do { \ - spinlock_t * __lock = A; \ - int __gotlock = 0; \ - while(1) { \ - __asm__ __volatile__("tas.b @%1\n\t" \ - "movt %0\n\t" \ - : "=r" (__gotlock) \ - : "r" (__lock) \ - : "t", "memory"); \ - if(!__gotlock) \ - thd_pass(); \ - else break; \ - } \ - } while(0) +static inline void spinlock_lock(spinlock_t *lock) { + while(!spinlock_trylock(lock)) + thd_pass(); +} -/** \brief Try to lock, without spinning. +/** \brief Spin on a lock. - This macro will attempt to lock the lock, but will not spin. Instead, it - will return whether the lock was obtained or not. + This function will spin on the lock, and will not return until the lock has + been obtained for the calling thread, unless it is called from within an + interrupt context. - \param A A pointer to the spinlock to be locked. - \return 0 if the lock is held by another thread. Non-zero if - the lock was successfully obtained. + \param lock A pointer to the spinlock to be locked. + \return True if the spinlock could be locked, false otherwise. */ -#define spinlock_trylock(A) ({ \ - int __gotlock = 0; \ - do { \ - spinlock_t *__lock = A; \ - __asm__ __volatile__("tas.b @%1\n\t" \ - "movt %0\n\t" \ - : "=r" (__gotlock) \ - : "r" (__lock) \ - : "t", "memory"); \ - } while(0); \ - __gotlock; \ - }) +static inline bool spinlock_lock_irqsafe(spinlock_t *lock) { + if(irq_inside_int()) + return spinlock_trylock(lock); + + spinlock_lock(lock); + return true; +} /** \brief Free a lock. - This macro will unlock the lock that is currently held by the calling - thread. Do not use this macro unless you actually hold the lock! + This function will unlock the lock that is currently held by the calling + thread. Do not use this function unless you actually hold the lock! - \param A A pointer to the spinlock to be unlocked. + \param lock A pointer to the spinlock to be unlocked. */ -#define spinlock_unlock(A) do { \ - *(A) = 0; \ - } while(0) +static inline void spinlock_unlock(spinlock_t *lock) { + *lock = 0; +} /** \brief Determine if a lock is locked. - This macro will return whether or not the lock specified is actually locked + This function will return whether or not the lock specified is actually locked when it is called. This is NOT a thread-safe way of determining if a lock will be locked when you get around to locking it! - \param A A pointer to the spinlock to be checked. + \param lock A pointer to the spinlock to be checked. + \return True if the spinlock is locked, false otherwise. +*/ +static inline bool spinlock_is_locked(spinlock_t *lock) { + return *lock != 0; +} + +/** \cond INTERNAL */ +static inline void __spinlock_scoped_cleanup(spinlock_t **lock) { + spinlock_unlock(*lock); +} + +#define ___spinlock_lock_scoped(m, l) \ + spinlock_t *__scoped_spinlock_##l __attribute__((cleanup(__spinlock_scoped_cleanup))) = (spinlock_lock(m), (m)) +#define __spinlock_lock_scoped(m, l) ___spinlock_lock_scoped(m, l) +/** \endcond */ + +/** \brief Spin on a lock with scope management. + + This macro will spin on the lock, similar to spinlock_lock(), with the + difference that the lock will automatically be freed once the execution + exits the functional block in which the macro was called. + + \param lock A pointer to the spinlock to be locked. */ -#define spinlock_is_locked(A) ( *(A) != 0 ) +#define spinlock_lock_scoped(lock) \ + __spinlock_lock_scoped((lock), __LINE__) __END_DECLS diff --git a/kernel/arch/dreamcast/kernel/irq.c b/kernel/arch/dreamcast/kernel/irq.c index 658819c0..edab4a3b 100644 --- a/kernel/arch/dreamcast/kernel/irq.c +++ b/kernel/arch/dreamcast/kernel/irq.c @@ -39,7 +39,7 @@ struct trapa_cb { }; /* Individual exception handlers */ -static struct irq_cb irq_handlers[0x100]; +static struct irq_cb irq_handlers[0x40]; /* TRAPA exception handlers */ static struct trapa_cb trapa_handlers[0x100]; @@ -62,7 +62,7 @@ int irq_set_handler(irq_t code, irq_handler hnd, void *data) { if(code >= 0x1000 || (code & 0x000f)) return -1; - code >>= 4; + code >>= 5; irq_handlers[code] = (struct irq_cb){ hnd, data }; return 0; @@ -74,7 +74,7 @@ irq_handler irq_get_handler(irq_t code) { if(code >= 0x1000 || (code & 0x000f)) return NULL; - code >>= 4; + code >>= 5; return irq_handlers[code].hdl; } @@ -226,7 +226,7 @@ void irq_handle_exception(int code) { } if(inside_int) { - hnd = &irq_handlers[EXC_DOUBLE_FAULT >> 4]; + hnd = &irq_handlers[EXC_DOUBLE_FAULT >> 5]; if(hnd->hdl != NULL) hnd->hdl(EXC_DOUBLE_FAULT, irq_srt_addr, hnd->data); else @@ -266,7 +266,7 @@ void irq_handle_exception(int code) { /* If there's a handler, call it */ { - hnd = &irq_handlers[evt >> 4]; + hnd = &irq_handlers[evt >> 5]; if(hnd->hdl != NULL) { hnd->hdl(evt, irq_srt_addr, hnd->data); handled = 1; @@ -274,7 +274,7 @@ void irq_handle_exception(int code) { } if(!handled) { - hnd = &irq_handlers[EXC_UNHANDLED_EXC >> 4]; + hnd = &irq_handlers[EXC_UNHANDLED_EXC >> 5]; if(hnd->hdl != NULL) hnd->hdl(evt, irq_srt_addr, hnd->data); else diff --git a/kernel/arch/dreamcast/sound/snd_mem.c b/kernel/arch/dreamcast/sound/snd_mem.c index 1e6e5527..a458817a 100644 --- a/kernel/arch/dreamcast/sound/snd_mem.c +++ b/kernel/arch/dreamcast/sound/snd_mem.c @@ -72,14 +72,9 @@ int snd_mem_init(uint32 reserve) { if(initted) snd_mem_shutdown(); ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |