2002-07-12 Chris Demetriou <cgd@broadcom.com>
* mips/array.ld (hardware_exit_hook, hardware_hazard_hook): New
        symbols for optionally-provided functions.
        * mips/ddb-kseg0.ld: Likewise.
        * mips/ddb.ld: Likewise.
        * mips/dve.ld: Likewise.
        * mips/idt.ld: Likewise.
        * mips/idt32.ld: Likewise.
        * mips/idt64.ld: Likewise.
        * mips/idtecoff.ld: Likewise.
        * mips/jmr3904app-java.ld: Likewise.
        * mips/jmr3904app.ld: Likewise.
        * mips/jmr3904dram-java.ld: Likewise.
        * mips/jmr3904dram.ld: Likewise.
        * mips/lsi.ld: Likewise.
        * mips/nullmon.ld: Likewise.
        * mips/pmon.ld: Likewise.
        * mips/crt0.S: Invoke hardware_exit_hook and hardware_hazard_hook
        functions if they are provided.
        (_exit): Handle __embedded_pic properly.
			
			
This commit is contained in:
		| @@ -1,3 +1,25 @@ | |||||||
|  | 2002-07-12  Chris Demetriou  <cgd@broadcom.com> | ||||||
|  |  | ||||||
|  |         * mips/array.ld (hardware_exit_hook, hardware_hazard_hook): New | ||||||
|  |         symbols for optionally-provided functions. | ||||||
|  |         * mips/ddb-kseg0.ld: Likewise. | ||||||
|  |         * mips/ddb.ld: Likewise. | ||||||
|  |         * mips/dve.ld: Likewise. | ||||||
|  |         * mips/idt.ld: Likewise. | ||||||
|  |         * mips/idt32.ld: Likewise. | ||||||
|  |         * mips/idt64.ld: Likewise. | ||||||
|  |         * mips/idtecoff.ld: Likewise. | ||||||
|  |         * mips/jmr3904app-java.ld: Likewise. | ||||||
|  |         * mips/jmr3904app.ld: Likewise. | ||||||
|  |         * mips/jmr3904dram-java.ld: Likewise. | ||||||
|  |         * mips/jmr3904dram.ld: Likewise. | ||||||
|  |         * mips/lsi.ld: Likewise. | ||||||
|  |         * mips/nullmon.ld: Likewise. | ||||||
|  |         * mips/pmon.ld: Likewise. | ||||||
|  |         * mips/crt0.S: Invoke hardware_exit_hook and hardware_hazard_hook | ||||||
|  |         functions if they are provided. | ||||||
|  |         (_exit): Handle __embedded_pic properly. | ||||||
|  |  | ||||||
| 2002-06-18  Dave Brolley  <brolley@redhat.com> | 2002-06-18  Dave Brolley  <brolley@redhat.com> | ||||||
|  |  | ||||||
| 	From Catherine Moore, Michael Meissner, Richard Sandiford: | 	From Catherine Moore, Michael Meissner, Richard Sandiford: | ||||||
|   | |||||||
| @@ -74,6 +74,8 @@ PROVIDE (__stack = 1M - 8); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -54,11 +54,13 @@ | |||||||
|  */ |  */ | ||||||
| 	nop | 	nop | ||||||
|  |  | ||||||
|  | 	.globl	hardware_hazard_hook .text | ||||||
| 	.globl	_start | 	.globl	_start | ||||||
| 	.ent	_start | 	.ent	_start | ||||||
| _start: | _start: | ||||||
| 	.set	noreorder | 	.set	noreorder | ||||||
| #ifdef __mips_embedded_pic | #ifdef __mips_embedded_pic | ||||||
|  | #define PICBASE start_PICBASE | ||||||
| 	PICBASE = .+8 | 	PICBASE = .+8 | ||||||
|         bal	PICBASE |         bal	PICBASE | ||||||
| 	nop | 	nop | ||||||
| @@ -75,6 +77,14 @@ _start: | |||||||
| 	mtc0	zero, C0_CAUSE | 	mtc0	zero, C0_CAUSE | ||||||
| 	nop | 	nop | ||||||
|  |  | ||||||
|  | 	/* Avoid hazard from FPU enable and other SR changes.  */ | ||||||
|  | 	LA (t0, hardware_hazard_hook) | ||||||
|  | 	beq	t0,zero,1f | ||||||
|  | 	nop | ||||||
|  | 	jal	t0 | ||||||
|  | 	nop | ||||||
|  | 1: | ||||||
|  |  | ||||||
| /* Check for FPU presence.  Don't check if we know that soft_float is | /* Check for FPU presence.  Don't check if we know that soft_float is | ||||||
|    being used.  (This also avoids illegal instruction exceptions.)  */ |    being used.  (This also avoids illegal instruction exceptions.)  */ | ||||||
|  |  | ||||||
| @@ -97,6 +107,12 @@ _start: | |||||||
| 	li	v0, (STATUS_MASK-(STATUS_MASK & SR_CU1)) | 	li	v0, (STATUS_MASK-(STATUS_MASK & SR_CU1)) | ||||||
| 	mtc0	v0, C0_SR | 	mtc0	v0, C0_SR | ||||||
| 	nop | 	nop | ||||||
|  | 	/* Avoid hazard from FPU disable.  */ | ||||||
|  | 	LA (t0, hardware_hazard_hook) | ||||||
|  | 	beq	t0,zero,2f | ||||||
|  | 	nop | ||||||
|  | 	jal	t0 | ||||||
|  | 	nop | ||||||
| 2: | 2: | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -206,6 +222,11 @@ init: | |||||||
| 	move	a0,v0				# pass through the exit code | 	move	a0,v0				# pass through the exit code | ||||||
| 	.end	init | 	.end	init | ||||||
|  |  | ||||||
|  | /* Assume the PICBASE set up above is no longer valid below here.  */ | ||||||
|  | #ifdef __mips_embedded_pic | ||||||
|  | #undef PICBASE | ||||||
|  | #endif | ||||||
|  | 	 | ||||||
| /* | /* | ||||||
|  * _exit -- Exit from the application. Normally we cause a user trap |  * _exit -- Exit from the application. Normally we cause a user trap | ||||||
|  *          to return to the ROM monitor for another run. NOTE: This is |  *          to return to the ROM monitor for another run. NOTE: This is | ||||||
| @@ -214,14 +235,32 @@ init: | |||||||
|  *          executables that contain a complete world to be linked with |  *          executables that contain a complete world to be linked with | ||||||
|  *          just the crt0.o object. |  *          just the crt0.o object. | ||||||
|  */ |  */ | ||||||
|  | 	.globl	hardware_exit_hook .text | ||||||
| 	.globl	_exit | 	.globl	_exit | ||||||
| 	.ent _exit | 	.ent _exit | ||||||
| _exit: | _exit: | ||||||
| 7: | 7: | ||||||
|  | #ifdef __mips_embedded_pic | ||||||
|  | 	/* Need to reinit PICBASE, since we might be called via exit() | ||||||
|  | 	   rather than via a return path which would restore old s0.  */ | ||||||
|  | #define PICBASE exit_PICBASE | ||||||
|  | 	PICBASE = .+8 | ||||||
|  | 	bal	PICBASE | ||||||
|  | 	nop | ||||||
|  | 	move	s0,$31 | ||||||
|  | #endif | ||||||
| #ifdef GCRT0 | #ifdef GCRT0 | ||||||
| 	jal	_mcleanup | 	LA (t0, _mcleanup) | ||||||
|  | 	jal	t0 | ||||||
| 	nop | 	nop | ||||||
| #endif | #endif | ||||||
|  | 	LA (t0, hardware_exit_hook) | ||||||
|  | 	beq	t0,zero,1f | ||||||
|  | 	nop | ||||||
|  | 	jal	t0 | ||||||
|  | 	nop | ||||||
|  | 1: | ||||||
|  |  | ||||||
| 	# break instruction can cope with 0xfffff, but GAS limits the range: | 	# break instruction can cope with 0xfffff, but GAS limits the range: | ||||||
| 	break	1023 | 	break	1023 | ||||||
| 	nop | 	nop | ||||||
| @@ -229,4 +268,9 @@ _exit: | |||||||
| 	nop | 	nop | ||||||
| 	.end _exit | 	.end _exit | ||||||
|  |  | ||||||
|  | /* Assume the PICBASE set up above is no longer valid below here.  */ | ||||||
|  | #ifdef __mips_embedded_pic | ||||||
|  | #undef PICBASE | ||||||
|  | #endif | ||||||
|  |  | ||||||
| /* EOF crt0.S */ | /* EOF crt0.S */ | ||||||
|   | |||||||
| @@ -22,6 +22,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -22,6 +22,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -22,6 +22,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -23,6 +23,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -25,6 +25,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -25,6 +25,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -25,6 +25,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -22,6 +22,8 @@ PROVIDE (_Jv_QthreadsStackSize = 0x10000); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -19,6 +19,8 @@ PROVIDE (_mem_size = 0x100000); /* JMR3904 comes as standard with 512k of RAM */ | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -23,6 +23,8 @@ PROVIDE (_Jv_QthreadsStackSize = 0x10000); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -20,6 +20,8 @@ PROVIDE (_mem_size = 0x100000); /* JMR3904 comes as standard with 512k of RAM */ | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -23,6 +23,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -23,6 +23,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
| @@ -23,6 +23,8 @@ PROVIDE (__stack = 0); | |||||||
|  * We have to initalize them twice, so we multiple object file |  * We have to initalize them twice, so we multiple object file | ||||||
|  * formats, as some prepend an underscore. |  * formats, as some prepend an underscore. | ||||||
|  */ |  */ | ||||||
|  | PROVIDE (hardware_exit_hook = 0); | ||||||
|  | PROVIDE (hardware_hazard_hook = 0); | ||||||
| PROVIDE (hardware_init_hook = 0); | PROVIDE (hardware_init_hook = 0); | ||||||
| PROVIDE (software_init_hook = 0); | PROVIDE (software_init_hook = 0); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user