From: <ljs...@us...> - 2007-08-04 02:42:39
|
Revision: 432 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=432&view=rev Author: ljsebald Date: 2007-08-03 19:42:38 -0700 (Fri, 03 Aug 2007) Log Message: ----------- No more cast expressions as lvalues... Modified Paths: -------------- kos/kernel/arch/dreamcast/kernel/exec.c kos/kernel/arch/dreamcast/kernel/init.c Modified: kos/kernel/arch/dreamcast/kernel/exec.c =================================================================== --- kos/kernel/arch/dreamcast/kernel/exec.c 2007-08-03 04:26:06 UTC (rev 431) +++ kos/kernel/arch/dreamcast/kernel/exec.c 2007-08-04 02:42:38 UTC (rev 432) @@ -85,7 +85,7 @@ /* Jump to the trampoline */ { void (*trampoline)() __noreturn; - ((uint32 *)trampoline) = buffer; + *((uint32 *) &trampoline) = (uint32)buffer; trampoline(); } } Modified: kos/kernel/arch/dreamcast/kernel/init.c =================================================================== --- kos/kernel/arch/dreamcast/kernel/init.c 2007-08-03 04:26:06 UTC (rev 431) +++ kos/kernel/arch/dreamcast/kernel/init.c 2007-08-04 02:42:38 UTC (rev 432) @@ -23,6 +23,8 @@ extern int _bss_start, end; +void _atexit_call_all(); + /* Ditto */ int main(int argc, char **argv); @@ -251,13 +253,15 @@ /* Called to jump back to the BIOS menu; assumes a normal shutdown is possible */ void arch_menu() { + void (*menu)(int) __noreturn; + /* Shut down */ arch_shutdown(); /* Jump to the menus */ dbglog(DBG_CRITICAL, "arch: exiting the system to the BIOS menu\n"); - - { void (*menu)(int) __noreturn; ((uint32 *)menu) = *((uint32 *)0x8c0000e0); menu(1); } + *((uint32 *) &menu) = *((uint32 *) 0x8c0000e0); + menu(1); } /* Called to shut down non-gracefully; assume the system is in peril @@ -287,11 +291,14 @@ /* Called to reboot the system; assume the system is in peril and don't try to call the dtors */ void arch_reboot() { + void (*rb)() __noreturn; + dbglog(DBG_CRITICAL, "arch: rebooting the system\n"); /* Ensure that interrupts are disabled */ irq_disable(); /* Reboot */ - { void (*rb)() __noreturn; ((uint32*)rb) = (uint32 *)0xa0000000; rb(); } + *((uint32 *) &rb) = 0xa0000000; + rb(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2007-08-04 17:39:52
|
Revision: 433 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=433&view=rev Author: ljsebald Date: 2007-08-04 10:39:47 -0700 (Sat, 04 Aug 2007) Log Message: ----------- A little cleaner way of dealing with those lvalue casts. Modified Paths: -------------- kos/kernel/arch/dreamcast/kernel/exec.c kos/kernel/arch/dreamcast/kernel/init.c Modified: kos/kernel/arch/dreamcast/kernel/exec.c =================================================================== --- kos/kernel/arch/dreamcast/kernel/exec.c 2007-08-04 02:42:38 UTC (rev 432) +++ kos/kernel/arch/dreamcast/kernel/exec.c 2007-08-04 17:39:47 UTC (rev 433) @@ -84,8 +84,9 @@ /* Jump to the trampoline */ { - void (*trampoline)() __noreturn; - *((uint32 *) &trampoline) = (uint32)buffer; + typedef void (*trampoline_func)() __noreturn; + trampoline_func trampoline = (trampoline_func)buffer; + trampoline(); } } Modified: kos/kernel/arch/dreamcast/kernel/init.c =================================================================== --- kos/kernel/arch/dreamcast/kernel/init.c 2007-08-04 02:42:38 UTC (rev 432) +++ kos/kernel/arch/dreamcast/kernel/init.c 2007-08-04 17:39:47 UTC (rev 433) @@ -253,14 +253,15 @@ /* Called to jump back to the BIOS menu; assumes a normal shutdown is possible */ void arch_menu() { - void (*menu)(int) __noreturn; + typedef void (*menufunc)(int) __noreturn; + menufunc menu; /* Shut down */ arch_shutdown(); /* Jump to the menus */ dbglog(DBG_CRITICAL, "arch: exiting the system to the BIOS menu\n"); - *((uint32 *) &menu) = *((uint32 *) 0x8c0000e0); + menu = (menufunc)(*((uint32 *) 0x8c0000e0)); menu(1); } @@ -291,7 +292,8 @@ /* Called to reboot the system; assume the system is in peril and don't try to call the dtors */ void arch_reboot() { - void (*rb)() __noreturn; + typedef void (*reboot_func)() __noreturn; + reboot_func rb; dbglog(DBG_CRITICAL, "arch: rebooting the system\n"); @@ -299,6 +301,6 @@ irq_disable(); /* Reboot */ - *((uint32 *) &rb) = 0xa0000000; + rb = (reboot_func)0xa0000000; rb(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <at...@us...> - 2007-08-12 23:23:20
|
Revision: 454 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=454&view=rev Author: atani Date: 2007-08-12 16:23:19 -0700 (Sun, 12 Aug 2007) Log Message: ----------- use make_banner.sh, #!/bin/bash instead of #!/bin/sh Modified Paths: -------------- kos/kernel/arch/dreamcast/kernel/Makefile kos/kernel/arch/dreamcast/kernel/make_banner.sh Modified: kos/kernel/arch/dreamcast/kernel/Makefile =================================================================== --- kos/kernel/arch/dreamcast/kernel/Makefile 2007-08-12 23:17:55 UTC (rev 453) +++ kos/kernel/arch/dreamcast/kernel/Makefile 2007-08-12 23:23:19 UTC (rev 454) @@ -26,8 +26,9 @@ banner.o: banner.c -banner.c: - echo 'char banner[] = "KallistiOS ##version##: $(shell date)\n $(shell whoami)@$(shell hostname):$(KOS_BASE)\n";'>$@ +banner.c: make_banner.sh + ./make_banner.sh + #echo 'char banner[] = "KallistiOS ##version##: $(shell date)\n $(shell whoami)@$(shell hostname):$(KOS_BASE)\n";'>$@ arch_exports.o: arch_exports.c Modified: kos/kernel/arch/dreamcast/kernel/make_banner.sh =================================================================== --- kos/kernel/arch/dreamcast/kernel/make_banner.sh 2007-08-12 23:17:55 UTC (rev 453) +++ kos/kernel/arch/dreamcast/kernel/make_banner.sh 2007-08-12 23:23:19 UTC (rev 454) @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Re-creates the banner.c file for each compilation run This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |