fix ST RAM header writes
Newer compilers refuse to dereference NULL pointers. Fix this with special "no-delete-null-pointer-checks" function attribute
This commit is contained in:
@@ -568,7 +568,6 @@ Doxyfile
|
|||||||
dump.bdm
|
dump.bdm
|
||||||
Makefile
|
Makefile
|
||||||
mcf5474.gdb
|
mcf5474.gdb
|
||||||
svn-commit.tmp
|
|
||||||
tos/pci_test/include/bas_printf.h
|
tos/pci_test/include/bas_printf.h
|
||||||
tos/pci_test/include/bas_string.h
|
tos/pci_test/include/bas_string.h
|
||||||
tos/pci_test/include/driver_vec.h
|
tos/pci_test/include/driver_vec.h
|
||||||
|
|||||||
@@ -379,6 +379,29 @@ void init_isr(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Jump into the OS */
|
||||||
|
typedef void void_func(void);
|
||||||
|
struct rom_header
|
||||||
|
{
|
||||||
|
void *initial_sp;
|
||||||
|
void_func *initial_pc;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fix ST RAM header (address 0x0 and 0x4). FreeMiNT uses these vectors on CTRL-ALT-DEL.
|
||||||
|
*
|
||||||
|
* Beware: Newer compilers refuse to dereference pointers to NULL and abort if the following
|
||||||
|
* attribute isn't set.
|
||||||
|
*/
|
||||||
|
static inline void fix_stram_header() __attribute__((optimize("no-delete-null-pointer-checks")));
|
||||||
|
static inline void fix_stram_header()
|
||||||
|
{
|
||||||
|
struct rom_header *bas_header = (struct rom_header *) TARGET_ADDRESS;
|
||||||
|
struct rom_header *stram_header = (struct rom_header *) 0x0;
|
||||||
|
|
||||||
|
*stram_header = *bas_header;
|
||||||
|
}
|
||||||
|
|
||||||
void BaS(void)
|
void BaS(void)
|
||||||
{
|
{
|
||||||
uint8_t *src;
|
uint8_t *src;
|
||||||
@@ -473,14 +496,6 @@ void BaS(void)
|
|||||||
|
|
||||||
srec_execute("BASFLASH.S19");
|
srec_execute("BASFLASH.S19");
|
||||||
|
|
||||||
/* Jump into the OS */
|
|
||||||
typedef void void_func(void);
|
|
||||||
struct rom_header
|
|
||||||
{
|
|
||||||
void *initial_sp;
|
|
||||||
void_func *initial_pc;
|
|
||||||
};
|
|
||||||
|
|
||||||
xprintf("BaS initialization finished, enable interrupts\r\n");
|
xprintf("BaS initialization finished, enable interrupts\r\n");
|
||||||
init_isr();
|
init_isr();
|
||||||
|
|
||||||
@@ -542,10 +557,7 @@ void BaS(void)
|
|||||||
* like on original STs (where these values reside in ROM) and uses them on
|
* like on original STs (where these values reside in ROM) and uses them on
|
||||||
* CTRL-ALT-DELETE reboots.
|
* CTRL-ALT-DELETE reboots.
|
||||||
*/
|
*/
|
||||||
struct rom_header *bas_header = (struct rom_header *) TARGET_ADDRESS;
|
fix_stram_header();
|
||||||
struct rom_header *stram_header = (struct rom_header *) 0x0;
|
|
||||||
|
|
||||||
*stram_header = *bas_header;
|
|
||||||
|
|
||||||
xprintf("call EmuTOS\r\n");
|
xprintf("call EmuTOS\r\n");
|
||||||
struct rom_header *os_header = (struct rom_header *) TOS;
|
struct rom_header *os_header = (struct rom_header *) TOS;
|
||||||
|
|||||||
Reference in New Issue
Block a user