+ Added mipsel-android startup files by Vsevolod Alekseyev.

git-svn-id: trunk@26688 -
This commit is contained in:
yury 2014-02-06 18:33:23 +00:00
parent 576fe3758d
commit b995da1e06
4 changed files with 148 additions and 0 deletions

2
.gitattributes vendored
View File

@ -7719,6 +7719,8 @@ rtl/android/jvm/androidr14.pas svneol=native#text/plain
rtl/android/jvm/java_sys_android.inc svneol=native#text/plain
rtl/android/jvm/java_sysh_android.inc svneol=native#text/plain
rtl/android/jvm/rtl.cfg svneol=native#text/plain
rtl/android/mipsel/dllprt0.as svneol=native#text/plain
rtl/android/mipsel/prt0.as svneol=native#text/plain
rtl/arm/arm.inc svneol=native#text/plain
rtl/arm/armdefines.inc svneol=native#text/plain
rtl/arm/int64p.inc svneol=native#text/plain

View File

@ -97,6 +97,12 @@ ifeq ($(ARCH),i386)
ASTARGET=--32
endif
# Select mips32 instruction set and PIC for MIPS
ifeq ($(ARCH),mipsel)
ASTARGET=-mips32 -KPIC
endif
#
# Loaders
#

View File

@ -0,0 +1,83 @@
/*
Library startup code for Android/MIPS
by Vsevolod Alekseyev
*/
.set noat
.section ".text"
.align 4
.global FPC_SHARED_LIB_START
FPC_SHARED_LIB_START:
.ent FPC_SHARED_LIB_START
.frame $sp, 32, $ra
.set noreorder
.cpload $t9
/*
Stack structure:
sp+16 - gp
sp+20 - sp
sp+24 - ra
*/
/* Save old sp, align the stack, set up the frame, save regs */
move $t0, $sp
li $t1, -8
and $sp, $sp, $t1
subu $sp, $sp, 32
.cprestore 16
sw $t0, 20($sp)
sw $ra, 24($sp)
/* Save initial stack pointer, return address */
la $t0, __stkptr
sw $sp, ($t0)
/* Get environment from libc */
la $t0, environ
lw $t0, ($t0)
bne $t0, $zero, GotEnv
nop
la $t0, EmptyEnv
GotEnv:
la $t1, operatingsystem_parameter_envp
sw $t0, ($t1)
/* Register exit handler */
la $a0, FPC_LIB_EXIT
jal atexit
nop
/* Call main, exit */
jal PASCALMAIN
nop
/* restore registers, exit */
lw $ra, 24($sp)
jr $ra
lw $sp, 20($sp)
.end FPC_SHARED_LIB_START
.size FPC_SHARED_LIB_START, .-FPC_SHARED_LIB_START
/*************************/
.global _haltproc
_haltproc:
.ent _haltproc
.set noreorder
.cpload $t9
la $t9, exit
jr $t9
nop
.end _haltproc
.size _haltproc, .-_haltproc
/*************************/
.comm __stkptr,4
.comm operatingsystem_parameter_envp,4
EmptyEnv:
.long 0
.long 0
.long 0

View File

@ -0,0 +1,57 @@
/*
Startup code for Android/MIPS
by Vsevolod Alekseyev
*/
.set at
.section ".text"
.align 4
.global _fpc_start
_fpc_start:
.ent _fpc_start
.set noreorder
.cpload $t9
/*Align the stack, save the old sp */
move $t0, $sp
li $t1, -8
and $sp, $sp, $t1
sw $t0, __stkptr
/* Get argc/argv/envp from the stack; old sp is in t0 */
lw $t1, ($t0)
sw $t1, (operatingsystem_parameter_argc)
addiu $t2, $t0, 4
sw $t2, (operatingsystem_parameter_argv)
addiu $t3, $t1, 1
sll $t3, $t3, 2
add $t2, $t2, $t3
sw $t2, (operatingsystem_parameter_envp)
la $t9, _start
jr $t9
nop
.end _fpc_start
/*************************/
.global _haltproc
_haltproc:
.ent _haltproc
.set noreorder
.cpload $t9
lw $a0, (operatingsystem_result)
la $t9, exit
jr $t9
nop
.end _haltproc
.size _haltproc, .-_haltproc
/*************************/
.comm __stkptr,4
.comm operatingsystem_parameter_envp,4
.comm operatingsystem_parameter_argc,4
.comm operatingsystem_parameter_argv,4